11const isProperFraction = require ( "../implement/2-is-proper-fraction" ) ;
22
3- // Case 1: Proper fraction
4- // When numerator < denominator, it should return true.
5- test ( "should return true for a proper fraction" , ( ) => {
63
74// Case 1: Proper Fraction
85// Given a numerator smaller than denominator (2/3),
@@ -12,9 +9,6 @@ test("should return true for a proper fraction (2/3)", () => {
129 expect ( isProperFraction ( 2 , 3 ) ) . toEqual ( true ) ;
1310} ) ;
1411
15- // Case 2: Improper fraction
16- // When numerator > denominator, it should return false.
17- test ( "should return false for an improper fraction" , ( ) => {
1812
1913// Case 2: Improper Fraction
2014// Given a numerator greater than denominator (5/2),
@@ -24,9 +18,6 @@ test("should return false for an improper fraction (5/2)", () => {
2418 expect ( isProperFraction ( 5 , 2 ) ) . toEqual ( false ) ;
2519} ) ;
2620
27- // Case 3: Negative proper fraction
28- // When numerator is negative but |numerator| < |denominator|, it should return true.
29- test ( "should return true for a negative proper fraction" , ( ) => {
3021
3122// Case 3: Negative Proper Fraction
3223// Given a negative proper fraction (-1/2),
@@ -36,10 +27,6 @@ test("should return true for a negative proper fraction (-1/2)", () => {
3627 expect ( isProperFraction ( - 1 , 2 ) ) . toEqual ( true ) ;
3728} ) ;
3829
39- // Case 4: Equal numerator and denominator
40- // When numerator === denominator, it should return false.
41- test ( "should return false for equal numerator and denominator" , ( ) => {
42-
4330// Case 4: Equal Numerator and Denominator
4431// Given a numerator equal to denominator (3/3),
4532// When the function is called,
@@ -78,34 +65,3 @@ test("should return true for large proper fractions", () => {
7865 expect ( isProperFraction ( 999 , 1000 ) ) . toEqual ( true ) ;
7966} ) ;
8067
81- // Case 5: Negative Improper Fraction
82- // Given a negative improper fraction (-4/3),
83- // When the function is called,
84- // Then it should return false because the absolute value is greater than 1.
85- test ( "should return false for a negative improper fraction (-4/3)" , ( ) => {
86- expect ( isProperFraction ( - 4 , 3 ) ) . toEqual ( false ) ;
87- } ) ;
88-
89- // Case 6: Both Negative (Proper Fraction)
90- // Given both numerator and denominator negative (-2/-3),
91- // When the function is called,
92- // Then it should return true because the value is positive and less than 1.
93- test ( "should return true for both negative proper fraction (-2/-3)" , ( ) => {
94- expect ( isProperFraction ( - 2 , - 3 ) ) . toEqual ( true ) ;
95- } ) ;
96-
97- // Case 7: Zero Numerator
98- // Given a numerator of 0 (0/5),
99- // When the function is called,
100- // Then it should return true because 0 is less than any nonzero denominator.
101- test ( "should return true for zero numerator (0/5)" , ( ) => {
102- expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( true ) ;
103- } ) ;
104-
105- // Case 8: Zero Denominator
106- // Given a denominator of 0 (5/0),
107- // When the function is called,
108- // Then it should return false because division by zero is undefined.
109- test ( "should return false for zero denominator (5/0)" , ( ) => {
110- expect ( isProperFraction ( 5 , 0 ) ) . toEqual ( false ) ;
111- } ) ;
0 commit comments