@@ -7,4 +7,33 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
77// Special case: numerator is zero
88test ( `should return false when denominator is zero` , ( ) => {
99 expect ( isProperFraction ( 1 , 0 ) ) . toEqual ( false ) ;
10+ expect ( isProperFraction ( 0 , 0 ) ) . toEqual ( false ) ;
11+ expect ( isProperFraction ( - 1 , 0 ) ) . toEqual ( false ) ;
12+ } ) ;
13+
14+ test ( `should return true when numerator and denominator both positive and numerator < denominator` , ( ) => {
15+ expect ( isProperFraction ( 1 , 2 ) ) . toEqual ( true ) ;
16+ expect ( isProperFraction ( 4 , 5 ) ) . toEqual ( true ) ;
17+ expect ( isProperFraction ( 2 , 3 ) ) . toEqual ( true ) ;
18+ } ) ;
19+
20+ test ( `should return true when numerator and denominator both negative and numerator < denominator` , ( ) => {
21+ expect ( isProperFraction ( - 3 , - 2 ) ) . toEqual ( true ) ;
22+ } ) ;
23+
24+ test ( `should return true when numerator is negative and numerator < denominator` , ( ) => {
25+ expect ( isProperFraction ( - 3 , 2 ) ) . toEqual ( true ) ;
26+ } ) ;
27+
28+ test ( `should return false when numerator > denominator` , ( ) => {
29+ expect ( isProperFraction ( 2 , 1 ) ) . toEqual ( false ) ;
30+ } ) ;
31+
32+ test ( `should return false when numerator > denominator, negative nums` , ( ) => {
33+ expect ( isProperFraction ( - 1 , - 2 ) ) . toEqual ( false ) ;
34+ } ) ;
35+
36+ test ( `should return false when numerator == denominator` , ( ) => {
37+ expect ( isProperFraction ( - 2 , - 2 ) ) . toEqual ( false ) ;
38+ expect ( isProperFraction ( 2 , 2 ) ) . toEqual ( false ) ;
1039} ) ;
0 commit comments