File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,21 @@ 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+ test ( "should return false when numerator is greater than denominator" , ( ) => {
12+ expect ( isProperFraction ( 5 , 2 ) ) . toEqual ( false ) ;
13+ } ) ;
14+ test ( "should return true when absolute numerator is less than absolute denominator" , ( ) => {
15+ expect ( isProperFraction ( - 4 , 7 ) ) . toEqual ( true ) ;
16+ } ) ;
17+ test ( "should return false when numerator equals denominator" , ( ) => {
18+ expect ( isProperFraction ( 3 , 3 ) ) . toEqual ( false ) ;
19+ } ) ;
20+ test ( "should return true when numerator < |denominator| and denominator is negative" , ( ) => {
21+ expect ( isProperFraction ( 4 , - 7 ) ) . toEqual ( true ) ;
22+ } ) ;
23+ test ( "should return true when numerator and denominator are both negative and |numerator| < |denominator|" , ( ) => {
24+ expect ( isProperFraction ( - 4 , - 7 ) ) . toEqual ( true ) ;
25+ } ) ;
26+ test ( "should return true when numerator is zero and denominator is negative" , ( ) => {
27+ expect ( isProperFraction ( 0 , - 5 ) ) . toEqual ( true ) ;
28+ } ) ;
You can’t perform that action at this time.
0 commit comments