You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(`should return true when numerator < denominator and both are integers`,()=>{
9
+
test(`should return true when the absolute value of the numerator is less than the absolute value of the denominator and the denominator is not 0`,()=>{
10
10
expect(isProperFraction(1,2)).toEqual(true);
11
-
expect(isProperFraction(3,9)).toEqual(true);
12
-
expect(isProperFraction(99,100)).toEqual(true);
11
+
expect(isProperFraction(3.5,4)).toEqual(true);
12
+
expect(isProperFraction(-99,-100)).toEqual(true);
13
+
expect(isProperFraction(0,-5)).toEqual(true);
14
+
expect(isProperFraction(8,12.5)).toEqual(true);
15
+
expect(isProperFraction(-6,12)).toEqual(true);
13
16
});
14
17
15
-
test(`should return false when denominator = zero`,()=>{
16
-
expect(isProperFraction(1,0)).toEqual(false);
17
-
expect(isProperFraction(5,0)).toEqual(false);
18
+
test(`should return false when the denominator is equal to zero`,()=>{
19
+
expect(isProperFraction(-1,0)).toEqual(false);
20
+
expect(isProperFraction(0,0)).toEqual(false);
21
+
expect(isProperFraction(15,0)).toEqual(false);
22
+
expect(isProperFraction(6.4,0)).toEqual(false);
23
+
expect(isProperFraction(-8.5,0)).toEqual(false);
18
24
});
19
25
20
-
test(`should return false when numerator = zero`,()=>{
21
-
expect(isProperFraction(0,5)).toEqual(false);
22
-
expect(isProperFraction(0,7)).toEqual(false);
23
-
});
24
-
25
-
test(`should return false when numerator > denominator`,()=>{
26
+
test(`should return false when the absolute value of the numerator is greater than the absolute value of the denominator`,()=>{
26
27
expect(isProperFraction(3,2)).toEqual(false);
27
-
expect(isProperFraction(9,3)).toEqual(false);
28
-
expect(isProperFraction(36,7)).toEqual(false);
29
-
});
30
-
31
-
test(`should return false when either numerator or denominator or both are float numbers`,()=>{
0 commit comments