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