@@ -5,13 +5,14 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
55// TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories.
66
77// Proper fractions - should return true
8- test ( `should return true for proper fractions (0 < numerator < denominator)` , ( ) => {
8+ test ( `should return true for proper fractions (0 <= numerator < denominator)` , ( ) => {
99 expect ( isProperFraction ( 1 , 2 ) ) . toEqual ( true ) ;
1010 expect ( isProperFraction ( 3 , 4 ) ) . toEqual ( true ) ;
1111 expect ( isProperFraction ( 1 , 5 ) ) . toEqual ( true ) ;
1212 expect ( isProperFraction ( 2 , 3 ) ) . toEqual ( true ) ;
1313 expect ( isProperFraction ( 5 , 8 ) ) . toEqual ( true ) ;
1414 expect ( isProperFraction ( 1 , 100 ) ) . toEqual ( true ) ;
15+ expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( true ) ;
1516} ) ;
1617
1718// Improper fractions - should return false
@@ -23,11 +24,11 @@ test(`should return false for improper fractions (numerator >= denominator)`, ()
2324 expect ( isProperFraction ( 100 , 99 ) ) . toEqual ( false ) ;
2425} ) ;
2526
26- // Edge cases with zero - should return false
27- test ( `should return false when numerator is zero` , ( ) => {
28- expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( false ) ;
29- expect ( isProperFraction ( 0 , 1 ) ) . toEqual ( false ) ;
30- expect ( isProperFraction ( 0 , 100 ) ) . toEqual ( false ) ;
27+ // Edge cases with zero numerator - should return true
28+ test ( `should return true when numerator is zero and denominator is positive ` , ( ) => {
29+ expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( true ) ;
30+ expect ( isProperFraction ( 0 , 1 ) ) . toEqual ( true ) ;
31+ expect ( isProperFraction ( 0 , 100 ) ) . toEqual ( true ) ;
3132} ) ;
3233
3334// Special case: denominator is zero
0 commit comments