Skip to content

Commit 59a4508

Browse files
committed
updates the test script of proper fraction function
1 parent 609355f commit 59a4508

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,17 @@ test(`should return false when denominator is zero`, () => {
99
expect(isProperFraction(1, 0)).toEqual(false);
1010
});
1111

12-
test(`should return true when (numerator < denominator)`, () => {
12+
test(`should return true when abs(numerator) < abs(denominator)`, () => {
1313
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)`, () => {
14+
expect(isProperFraction(-3, -6)).toEqual(true);
2115
expect(isProperFraction(1, 2)).toEqual(true);
2216
})
2317

24-
test(`should return false when (numerator > denominator)`, () => {
18+
test(`should return false when abs(numerator) > abs(denominator)`, () => {
2519
expect(isProperFraction(2, 1)).toEqual(false);
20+
expect(isProperFraction(-2, -1)).toEqual(false);
2621
})
2722

2823
test(`should return false when (numerator == denominator)`, () => {
2924
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);
3825
})

0 commit comments

Comments
 (0)