Skip to content

Commit 5bbd449

Browse files
Quinton KornegayQuinton Kornegay
Quinton Kornegay
authored and
Quinton Kornegay
committed
check five
1 parent 304ae43 commit 5bbd449

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

unit-testing/exercises/checkFive.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ function checkFive(num){
88
result = num + " is greater than 5.";
99
}
1010
return result;
11-
}
11+
}
12+
13+
console.log(checkFive(1));
14+
console.log(checkFive(5));
15+
console.log(checkFive(9));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const checkFive = require('../checkFive.js');
2+
3+
describe("checkFive", function(){
4+
5+
test("returns 'num is less than 5' when num < 5.", function() {
6+
let output = checkFive(2);
7+
expect(output).toEqual("2 is less than 5.");
8+
});
9+
test("returns 'num is equal to 5' when num equals 5.", function(){
10+
let output = checkFive(5);
11+
expect(output).toEqual("5 is equal to 5.");
12+
});
13+
test("returns 'num is greater than 5' when num > 5.", function(){
14+
let output = checkFive(7);
15+
expect(output).toEqual("7 is greater than 5.");
16+
});
17+
});

0 commit comments

Comments
 (0)