Skip to content

Commit b28e30e

Browse files
committed
added jest test cases
1 parent 5c0d472 commit b28e30e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,17 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
88
test(`should return false when denominator is zero`, () => {
99
expect(isProperFraction(1, 0)).toEqual(false);
1010
});
11+
test(`should return true when denominator is smaller or equal to the numerator`,() =>{
12+
expect(isProperFraction(2, 4)).toEqual(true);
13+
expect(isProperFraction(3, 3)).toEqual(true);
14+
expect(isProperFraction(5, 10)).toEqual(true);
15+
expect(isProperFraction(2, 2)).toEqual(true);
16+
});
17+
18+
test(`should return false when denominator is bigger than the numerator`, () => {
19+
expect(isProperFraction(5, -2)).toEqual(false);
20+
expect(isProperFraction(-1, 0)).toEqual(false);
21+
expect(isProperFraction(12, 4)).toEqual(false);
22+
23+
});
24+

0 commit comments

Comments
 (0)