Skip to content

Commit 630ae85

Browse files
committed
commit
1 parent 43a9f32 commit 630ae85

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,31 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
44

55
// TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories.
66

7-
// Special case: numerator is zero
7+
/// Special case: denominator is zero
88
test(`should return false when denominator is zero`, () => {
99
expect(isProperFraction(1, 0)).toEqual(false);
1010
});
11+
12+
//case:absolute numerator is bigger than absolute denominator
13+
test ('should return false when numerator absolute is bigger than denominator absolute',() => {
14+
expect(isProperFraction(5, -4)).toEqual(false);
15+
})
16+
17+
//case:numerator is the same as denominator
18+
test('should return false if numerator is the same as denominator', () =>{
19+
expect(isProperFraction(-9,-9)).toEqual(false)
20+
})
21+
22+
//case: absolute numerator is less than absolute denominator
23+
test ('should return true when numerator absolute is less than denominator absolute',() => {
24+
expect(isProperFraction(3,-8)).toEqual(true);
25+
})
26+
27+
//case: numerator is zero
28+
test(`should return true when nominator is zero`, () => {
29+
expect(isProperFraction(0,-3)).toEqual(true);
30+
});
31+
32+
33+
34+

0 commit comments

Comments
 (0)