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 Introduction
count-up-by's People
Forkers
jeremyjosolRecommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.