File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Sprint-3/1-implement-and-rewrite-tests/implement Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 88// write one test at a time, and make it pass, build your solution up methodically
99
1010function isProperFraction ( numerator , denominator ) {
11- if ( numerator < denominator ) {
12- return true ;
13- }
14- if ( numerator === denominator ) {
15- return false
16- }
17- if ( ( Math . abs ( numerator ) ) < denominator ) {
18- return true
19- }
20- if ( numerator > denominator ) {
11+ if ( denominator === 0 ) {
2112 return false ;
2213 }
23- if ( denominator === 0 ) {
24- return false
14+ if ( numerator < denominator && numerator > - denominator ) {
15+ return true ;
16+ } else {
17+ return false ;
2518 }
2619}
2720
21+
2822// The line below allows us to load the isProperFraction function into tests in other files.
2923// This will be useful in the "rewrite tests with jest" step.
3024module . exports = isProperFraction ;
You can’t perform that action at this time.
0 commit comments