11const isProperFraction = require ( "../implement/2-is-proper-fraction" ) ;
22
3- < << << << HEAD
43// Case 1: Proper fraction
54// When numerator < denominator, it should return true.
65test ( "should return true for a proper fraction" , ( ) => {
7- === === =
6+
87// Case 1: Proper Fraction
98// Given a numerator smaller than denominator (2/3),
109// When the function is called,
1110// Then it should return true because it's a proper fraction.
1211test ( "should return true for a proper fraction (2/3)" , ( ) => {
13- >>> >>> > 52740052 fb0ad97a2c7253a04978b14a15b9e763
1412 expect ( isProperFraction ( 2 , 3 ) ) . toEqual ( true ) ;
1513} ) ;
1614
17- < << << << HEAD
1815// Case 2: Improper fraction
1916// When numerator > denominator, it should return false.
2017test ( "should return false for an improper fraction" , ( ) => {
21- === === =
18+
2219// Case 2: Improper Fraction
2320// Given a numerator greater than denominator (5/2),
2421// When the function is called,
2522// Then it should return false because it's an improper fraction.
2623test ( "should return false for an improper fraction (5/2)" , ( ) => {
27- >>> >>> > 52740052 fb0ad97a2c7253a04978b14a15b9e763
2824 expect ( isProperFraction ( 5 , 2 ) ) . toEqual ( false ) ;
2925} ) ;
3026
31- < << << << HEAD
3227// Case 3: Negative proper fraction
3328// When numerator is negative but |numerator| < |denominator|, it should return true.
3429test ( "should return true for a negative proper fraction" , ( ) => {
35- === === =
30+
3631// Case 3: Negative Proper Fraction
3732// Given a negative proper fraction (-1/2),
3833// When the function is called,
3934// Then it should return true because the value is between -1 and 1.
4035test ( "should return true for a negative proper fraction (-1/2)" , ( ) => {
41- >>> >>> > 52740052 fb0ad97a2c7253a04978b14a15b9e763
4236 expect ( isProperFraction ( - 1 , 2 ) ) . toEqual ( true ) ;
4337} ) ;
4438
45- < << << << HEAD
4639// Case 4: Equal numerator and denominator
4740// When numerator === denominator, it should return false.
4841test ( "should return false for equal numerator and denominator" , ( ) => {
49- === === =
42+
5043// Case 4: Equal Numerator and Denominator
5144// Given a numerator equal to denominator (3/3),
5245// When the function is called,
5346// Then it should return false because it's equal to 1 (not proper).
5447test ( "should return false for equal numerator and denominator (3/3)" , ( ) => {
55- >>> >>> > 52740052 fb0ad97a2c7253a04978b14a15b9e763
5648 expect ( isProperFraction ( 3 , 3 ) ) . toEqual ( false ) ;
5749} ) ;
5850
59- < << << << HEAD
6051// Case 5: Zero numerator
6152// 0 divided by any non-zero denominator is a proper fraction.
6253test ( "should return true for zero numerator" , ( ) => {
@@ -87,7 +78,6 @@ test("should return true for large proper fractions", () => {
8778 expect ( isProperFraction ( 999 , 1000 ) ) . toEqual ( true ) ;
8879} ) ;
8980
90- = === ===
9181// Case 5: Negative Improper Fraction
9282// Given a negative improper fraction (-4/3),
9383// When the function is called,
@@ -119,5 +109,3 @@ test("should return true for zero numerator (0/5)", () => {
119109test ( "should return false for zero denominator (5/0)" , ( ) => {
120110 expect ( isProperFraction ( 5 , 0 ) ) . toEqual ( false ) ;
121111} ) ;
122-
123- > >>> >>> 52740052 fb0ad97a2c7253a04978b14a15b9e763
0 commit comments