@@ -8,3 +8,36 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
88test ( `should return false when denominator is zero` , ( ) => {
99 expect ( isProperFraction ( 1 , 0 ) ) . toEqual ( false ) ;
1010} ) ;
11+ // Proper fractions (positive numbers
12+ test ( `should return true when numerator is smaller than denominator` , ( ) => {
13+ expect ( isProperFraction ( 1 , 2 ) ) . toEqual ( true ) ;
14+ expect ( isProperFraction ( 3 , 4 ) ) . toEqual ( true ) ;
15+ } ) ;
16+
17+ // Equal numbers → not proper
18+ test ( `should return false when numerator equals denominator` , ( ) => {
19+ expect ( isProperFraction ( 2 , 2 ) ) . toEqual ( false ) ;
20+ } ) ;
21+
22+ // Improper fractions
23+ test ( `should return false when numerator is greater than denominator` , ( ) => {
24+ expect ( isProperFraction ( 5 , 4 ) ) . toEqual ( false ) ;
25+ expect ( isProperFraction ( 10 , 3 ) ) . toEqual ( false ) ;
26+ } ) ;
27+
28+ // Zero numerator
29+ test ( `should return true when numerator is zero and denominator is non-zero` , ( ) => {
30+ expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( true ) ;
31+ } ) ;
32+
33+ // Negative numbers
34+ test ( `should handle negative numbers correctly` , ( ) => {
35+ expect ( isProperFraction ( - 1 , 2 ) ) . toEqual ( true ) ;
36+ expect ( isProperFraction ( 1 , - 2 ) ) . toEqual ( true ) ;
37+ expect ( isProperFraction ( - 3 , - 2 ) ) . toEqual ( false ) ;
38+ } ) ;
39+
40+ // Both zero
41+ test ( `should return false when both numerator and denominator are zero` , ( ) => {
42+ expect ( isProperFraction ( 0 , 0 ) ) . toEqual ( false ) ;
43+ } ) ;
0 commit comments