Skip to content

Commit 599d6db

Browse files
committed
is-proper-fraction.test.js completed
1 parent d21f276 commit 599d6db

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,31 @@ 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+
12+
test(`should return true when (numerator < denominator)`, () => {
13+
expect(isProperFraction(0, 1)).toEqual(true);
14+
})
15+
16+
test(`should return true when (numerator < denominator)`, () => {
17+
expect(isProperFraction(-6, -3)).toEqual(true);
18+
})
19+
20+
test(`should return true when (numerator < denominator)`, () => {
21+
expect(isProperFraction(1, 2)).toEqual(true);
22+
})
23+
24+
test(`should return false when (numerator > denominator)`, () => {
25+
expect(isProperFraction(2, 1)).toEqual(false);
26+
})
27+
28+
test(`should return false when (numerator == denominator)`, () => {
29+
expect(isProperFraction(0, 0)).toEqual(false);
30+
})
31+
32+
test(`should return false when (numerator > denominator)`, () => {
33+
expect(isProperFraction(-1, -2)).toEqual(false);
34+
})
35+
36+
test(`should return false when (numerator > denominator)`, () => {
37+
expect(isProperFraction(0, -1)).toEqual(false);
38+
})

0 commit comments

Comments
 (0)