Skip to content

Commit 122cf3c

Browse files
committed
added negative tests in jest for the isProperFraction, tests pass
1 parent 728add3 commit 122cf3c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,15 @@ test(`should return true when is a proper fraction`, () => {
2121
test(`should return true when numerator is 0`, () => {
2222
expect(isProperFraction(0, 1)).toEqual(true);
2323
});
24+
25+
test(`proper fraction with a negative numerator but positive denominator`, () => {
26+
expect(isProperFraction(-2, 3)).toEqual(true);
27+
});
28+
29+
test(`proper fraction with a positive numerator but negative denominator`, () => {
30+
expect(isProperFraction(2, -3)).toEqual(true);
31+
});
32+
33+
test(`proper fraction with both a negative numerator and denominator`, () => {
34+
expect(isProperFraction(-2, -3)).toEqual(true);
35+
});

0 commit comments

Comments
 (0)