Skip to content

Commit 163c1d0

Browse files
committed
Write jest tests for 2-is-proper-fraction.test.js
1 parent e346b17 commit 163c1d0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ 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 false when (numerator >= denominator)`, () => {
13+
expect(isProperFraction(2, 1)).toEqual(false);
14+
expect(isProperFraction(2, 2)).toEqual(false);
15+
});
16+
17+
test(`should treat numerator and denominator as absolute values when determining proper fractions`, () => {
18+
expect(isProperFraction(-2, 3)).toEqual(true);
19+
expect(isProperFraction(-7, 2)).toEqual(false);
20+
});

0 commit comments

Comments
 (0)