Giter VIP home page Giter VIP logo

count-up-by's Introduction

Describe: countToBy()
Test 1: "It should return NaN if either input submission is empty"
Code:
  const countTo = "";
  const countBy = "";
  countUpBy(countTo, countBy);
Expected Output: NaN

Test 2: "It should return one number, the number given, if countTo and countBy are the same."
Code:
  const countTo = 5;
  const countBy = 5;
  countUpBy(countTo, countBy);

Expected Output: 5

Test 3: "It should return numbers 1 through 5, if countTo is 5 and countBy is 1."
Code:
  const countTo = 5;
  const countBy = 1;
  countUpBy(countTo, countBy);
Expected Output: 1, 2, 3, 4, 5

Test 4: "It should return NaN if user inputs anything other than a number for countTo or countBy."
Code:
  const countTo = 'string';
  const countBy = 'string';
  countUpBy(countTo, countBy);
Expected Output: NaN

Test 5: "It should return numbers 1 through 5, if countTo is '5' and countBy is '1'."
Code:
  const countTo = '5';
  const countBy = '1';
  countUpBy(countTo, countBy);
Expected Output: 1, 2, 3, 4, 5

Test 6: "It should return null if countTo value is smaller than countBy value."
Code:
  const countTo = 1;
  const countBy = 5;
  countUpBy(countTo, countBy);
Expected Output: null

Test 7: "It should return null if either countTo or countBy are negative values."
Code:
  const countTo = -1;
  const countBy = -5;
  countUpBy(countTo, countBy);
Expected Output: null

Test 8: "It should return an array, counting by 1 up to countTo, if only the countTo number is input."
Code:
  const countTo = 5;
  countUpBy(countTo);
Expected Output: 1, 2, 3, 4, 5

Test 9: "It should return an array counting by countBy up to countTo, if a floating point number is used for input."
Code:
  const countTo = 5;
  const countBy = 1.5;
  countUpBy(countTo, countBy);
Expected Output: 1.5, 3, 4.5

Test 10: "It should return null if no input is put into the function call."
Code:
  countUpBy();
Expected Output: null

count-up-by's People

Contributors

jfpalchak avatar

Watchers

 avatar

Forkers

jeremyjosol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.