From 21fb02379a149d9ded019636a29a75d03c3f9852 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Tue, 3 Mar 2026 20:38:02 +0000 Subject: [PATCH 01/12] Give the function call to the angles, and write the test for all cases, including boundary test and invalid test. --- .../implement/1-get-angle-type.js | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js index 9e05a871e2..c13bd7af00 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js @@ -15,7 +15,29 @@ // execute the code to ensure all tests pass. function getAngleType(angle) { - // TODO: Implement this function + if (angle <= 0 || angle >= 360) { + return "Invalid angle"; + } + + if (angle === 90) { + return "Right angle"; + } + + if (angle === 180) { + return "Straight angle"; + } + + if (angle > 0 && angle < 90) { + return "Acute angle"; + } + + if (angle > 90 && angle < 180) { + return "Obtuse angle"; + } + + if (angle > 180 && angle < 360) { + return "Reflex angle"; + } } // The line below allows us to load the getAngleType function into tests in other files. @@ -35,3 +57,34 @@ function assertEquals(actualOutput, targetOutput) { // Example: Identify Right Angles const right = getAngleType(90); assertEquals(right, "Right angle"); + + +const acute = getAngleType(45); +assertEquals(acute, "Acute angle"); + +const obtuse = getAngleType(120); +assertEquals(obtuse, "Obtuse angle"); + +const straight = getAngleType(180); +assertEquals(straight, "Straight angle"); + +const reflex = getAngleType(270); +assertEquals(reflex, "Reflex angle"); + +// Boundary test + +assertEquals(getAngleType(89), "Acute angle"); + +assertEquals(getAngleType(91), "Obtuse angle"); + +assertEquals(getAngleType(179), "Obtuse angle"); + +assertEquals(getAngleType(181), "Reflex angle"); + +// Invalid test + +assertEquals(getAngleType(0), "Invalid angle"); + +assertEquals(getAngleType(360), "Invalid angle"); + + From 25f474f2f5333ca02fc7a5777dfdaf2ae92b7cf1 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 06:39:23 +0000 Subject: [PATCH 02/12] Write a function isProperFraction and implement all test included. --- .../implement/2-is-proper-fraction.js | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js index 970cb9b641..5aaeb0ebd3 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -11,7 +11,11 @@ // execute the code to ensure all tests pass. function isProperFraction(numerator, denominator) { - // TODO: Implement this function + if (denominator === 0){ + return false; + } + + return Math.abs(numerator) < Math.abs(denominator); } // The line below allows us to load the isProperFraction function into tests in other files. @@ -27,7 +31,46 @@ function assertEquals(actualOutput, targetOutput) { } // TODO: Write tests to cover all cases. -// What combinations of numerators and denominators should you test? // Example: 1/2 is a proper fraction assertEquals(isProperFraction(1, 2), true); + +// Proper fraction +assertEquals(isProperFraction(2,4), true); + +// Improper fraction +assertEquals(isProperFraction(5,3), false); + +// Equal numerator & denominator +assertEquals(isProperFraction(5,5), false); + +// Negative numbers +assertEquals(isProperFraction(-1,-2), true); + +// Zero numerator +assertEquals(isProperFraction(0,5), true); + +// Zero denominator (invalid) +assertEquals(isProperFraction(2,0), false); + + + + + + + +// What combinations of numerators and denominators should you test? + +// Normal proper fractions + +// Improper fractions + +// Equal numerator & denominator + +// Negative numbers + +// Zero numerator + +// Zero denominator (invalid) + + From fa92fedeb0e4f139011b2bdb6734ae22198b6d6c Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 13:47:36 +0000 Subject: [PATCH 03/12] Implement new answers to this coursework. --- .../implement/3-get-card-value.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js index c7559e787e..8295a67ca0 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js @@ -22,7 +22,23 @@ // execute the code to ensure all tests pass. function getCardValue(card) { - // TODO: Implement this function + + const rank = card.slice(0, -1); + const suit = card.slice(-1); + + const validRanks = ["A","2","3","4","5","6","7","8","9","10","J","Q","K"]; + const validSuits = ["♠", "♥", "♦", "♣"]; + + + if (!validRanks.includes(rank) ||!validSuits.includes(suit) ) { + throw new Error("Invalid card"); + } + + if (rank === "A") return 11; + if (["J","Q","K"].includes(rank)) return 10; + + return Number(rank); + } // The line below allows us to load the getCardValue function into tests in other files. @@ -40,6 +56,10 @@ function assertEquals(actualOutput, targetOutput) { // TODO: Write tests to cover all outcomes, including throwing errors for invalid cards. // Examples: assertEquals(getCardValue("9♠"), 9); +assertEquals(getCardValue("A♠")); // 11 +assertEquals(getCardValue("10♦")); // 10 +assertEquals(getCardValue("3♥")); // 3 +assertEquals(getCardValue("K♣")); // 10 // Handling invalid cards try { @@ -50,3 +70,4 @@ try { } catch (e) {} // What other invalid card cases can you think of? +try { getCardValue("2$"); } catch(e) { console.log(e.message); } // "Invalid card" \ No newline at end of file From e09c22efdfd2bd018abc3680c1a8e649c52704f0 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 14:07:05 +0000 Subject: [PATCH 04/12] Add more test cases to the existing cases tested. --- .../implement/3-get-card-value.js | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js index 8295a67ca0..8f8e218519 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js @@ -22,23 +22,34 @@ // execute the code to ensure all tests pass. function getCardValue(card) { - - const rank = card.slice(0, -1); - const suit = card.slice(-1); - - const validRanks = ["A","2","3","4","5","6","7","8","9","10","J","Q","K"]; + const rank = card.slice(0, -1); + const suit = card.slice(-1); + + const validRanks = [ + "A", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "J", + "Q", + "K", + ]; const validSuits = ["♠", "♥", "♦", "♣"]; - - if (!validRanks.includes(rank) ||!validSuits.includes(suit) ) { + if (!validRanks.includes(rank) || !validSuits.includes(suit)) { throw new Error("Invalid card"); } if (rank === "A") return 11; - if (["J","Q","K"].includes(rank)) return 10; + if (["J", "Q", "K"].includes(rank)) return 10; return Number(rank); - } // The line below allows us to load the getCardValue function into tests in other files. @@ -56,10 +67,12 @@ function assertEquals(actualOutput, targetOutput) { // TODO: Write tests to cover all outcomes, including throwing errors for invalid cards. // Examples: assertEquals(getCardValue("9♠"), 9); -assertEquals(getCardValue("A♠")); // 11 -assertEquals(getCardValue("10♦")); // 10 -assertEquals(getCardValue("3♥")); // 3 -assertEquals(getCardValue("K♣")); // 10 +assertEquals(getCardValue("A♠"), 11); +assertEquals(getCardValue("10♦"), 10); +assertEquals(getCardValue("3♥"), 3); +assertEquals(getCardValue("K♣"), 10); +assertEquals(getCardValue("J♠"), 10); +assertEquals(getCardValue("Q♦"), 10); // Handling invalid cards try { @@ -70,4 +83,17 @@ try { } catch (e) {} // What other invalid card cases can you think of? -try { getCardValue("2$"); } catch(e) { console.log(e.message); } // "Invalid card" \ No newline at end of file +try { + getCardValue("2$"); + console.error("Error not thrown"); +} catch (e) {} // "Invalid card" + +try { + getCardValue("11♠"); + console.error("Error not thrown"); +} catch (e) {} + +try { + getCardValue("B♠"); + console.error("Error not thrown"); +} catch (e) {} From 11691ae9858f64d9446b74f3552918bc885527d6 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 15:23:34 +0000 Subject: [PATCH 05/12] Write test for all angles including invalid angles. --- .../1-get-angle-type.test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js index d777f348d3..92e9fa74c3 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js @@ -14,7 +14,30 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { }); // Case 2: Right angle +test(`should return "Right angle" when angle is exactly 90`, () => { + expect(getAngleType(90)).toEqual("Right angle"); +}) + // Case 3: Obtuse angles +test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { + expect(getAngleType(91)).toEqual("Obtuse angle"); + expect(getAngleType(120)).toEqual("Obtuse angle"); + expect(getAngleType(179)).toEqual("Obtuse angle"); +}); + // Case 4: Straight angle +test(`should return "Straight angle" when angle is exactly 180`, () => { + expect(getAngleType(180)).toEqual("Straight angle"); +}) // Case 5: Reflex angles +test(`should return "Reflex angle" when (180 < angle < 360)`, () => { + expect(getAngleType(181)).toEqual("Reflex angle"); + expect(getAngleType(270)).toEqual("Reflex angle"); + expect(getAngleType(359)).toEqual("Reflex angle"); +}); + // Case 6: Invalid angles +test(`should return "Invalid angle" when angle is 0 or negative`, () => { + expect(getAngleType(0)).toEqual("Invalid angle"); + expect(getAngleType(360)).toEqual("Invalid angle"); + }) \ No newline at end of file From 0c92b19a86fef871f5f226ad801f638a3960609d Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 15:36:44 +0000 Subject: [PATCH 06/12] Implement changes of test to all fractions. --- .../2-is-proper-fraction.test.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js index 7f087b2ba1..b519fcb675 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -8,3 +8,30 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); test(`should return false when denominator is zero`, () => { expect(isProperFraction(1, 0)).toEqual(false); }); + + +// Case 2: positive proper fractions +test(`should return true for positive proper fractions (numerator < denominator)`, () => { + expect(isProperFraction(1, 2)).toEqual(true); + expect(isProperFraction(2, 4)).toEqual(true); +}) + +// Case 3: negative proper fractions +test(`should return true for negative proper fractions (numerator < denominator)`, () => { + expect(isProperFraction(-1, -2)).toEqual(true); + expect(isProperFraction(-2, -4)).toEqual(true); +}) + +// Case 4: improper fractions (numerator >= denominator) +test(`should return false for improper fractions`, () => { + expect(isProperFraction(4, 2)).toEqual(false); + expect(isProperFraction(4, 4)).toEqual(false); + expect(isProperFraction(-6, 4)).toEqual(false); + expect(isProperFraction(7, -2)).toEqual(false); +}); + +// Case 5: numerator is zero +test(`should return true when numerator is 0 and denominator is non-zero`, () => { + expect(isProperFraction(0, 3)).toEqual(true); + expect(isProperFraction(0, -5)).toEqual(true); +}); \ No newline at end of file From d04de54754684b6b651e3c9bf3ae172823824cf9 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Wed, 4 Mar 2026 17:55:15 +0000 Subject: [PATCH 07/12] Implement test to all cards. --- .../3-get-card-value.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js index cf7f9dae2e..d5775c8b67 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -11,8 +11,25 @@ test(`Should return 11 when given an ace card`, () => { // Suggestion: Group the remaining test data into these categories: // Number Cards (2-10) +test("Should return the correct value for number cards", () => { + expect(getCardValue("2♠")).toEqual(2); + expect(getCardValue("10♦")).toEqual(10); +}); + + // Face Cards (J, Q, K) +test("Should return 10 for face cards (J, Q, K)", () => { + expect(getCardValue("J♠")).toEqual(10); + expect(getCardValue("Q♠")).toEqual(10); + expect(getCardValue("K♠")).toEqual(10); +}); + + // Invalid Cards +test("Should throw an error for invalid cards", () => { + expect(() => getCardValue(null)).toThrow(); + expect(() => getCardValue(undefined)).toThrow(); +}) // To learn how to test whether a function throws an error as expected in Jest, // please refer to the Jest documentation: From 36634de020f73907304c4fa7229662232b5c1f35 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Mar 2026 09:11:54 +0000 Subject: [PATCH 08/12] Indentation has been applied. --- .../implement/2-is-proper-fraction.js | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js index 5aaeb0ebd3..d913a8a5ce 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -11,11 +11,11 @@ // execute the code to ensure all tests pass. function isProperFraction(numerator, denominator) { - if (denominator === 0){ - return false; - } - - return Math.abs(numerator) < Math.abs(denominator); + if (denominator === 0) { + return false; + } + + return Math.abs(numerator) < Math.abs(denominator); } // The line below allows us to load the isProperFraction function into tests in other files. @@ -36,28 +36,22 @@ function assertEquals(actualOutput, targetOutput) { assertEquals(isProperFraction(1, 2), true); // Proper fraction -assertEquals(isProperFraction(2,4), true); +assertEquals(isProperFraction(2, 4), true); // Improper fraction -assertEquals(isProperFraction(5,3), false); +assertEquals(isProperFraction(5, 3), false); // Equal numerator & denominator -assertEquals(isProperFraction(5,5), false); +assertEquals(isProperFraction(5, 5), false); // Negative numbers -assertEquals(isProperFraction(-1,-2), true); +assertEquals(isProperFraction(-1, -2), true); // Zero numerator -assertEquals(isProperFraction(0,5), true); +assertEquals(isProperFraction(0, 5), true); // Zero denominator (invalid) -assertEquals(isProperFraction(2,0), false); - - - - - - +assertEquals(isProperFraction(2, 0), false); // What combinations of numerators and denominators should you test? @@ -72,5 +66,3 @@ assertEquals(isProperFraction(2,0), false); // Zero numerator // Zero denominator (invalid) - - From 0866294596182de7a3252cbd45141d9a7e699910 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Mar 2026 11:56:12 +0000 Subject: [PATCH 09/12] Implement new test values not on the boundaries lines 40-45 --- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js index 92e9fa74c3..fdb35f5890 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js @@ -16,7 +16,7 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { // Case 2: Right angle test(`should return "Right angle" when angle is exactly 90`, () => { expect(getAngleType(90)).toEqual("Right angle"); -}) +}); // Case 3: Obtuse angles test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { @@ -28,7 +28,7 @@ test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { // Case 4: Straight angle test(`should return "Straight angle" when angle is exactly 180`, () => { expect(getAngleType(180)).toEqual("Straight angle"); -}) +}); // Case 5: Reflex angles test(`should return "Reflex angle" when (180 < angle < 360)`, () => { expect(getAngleType(181)).toEqual("Reflex angle"); @@ -37,7 +37,9 @@ test(`should return "Reflex angle" when (180 < angle < 360)`, () => { }); // Case 6: Invalid angles -test(`should return "Invalid angle" when angle is 0 or negative`, () => { +test(`should return "Invalid angle" when angle <= 0 or >= 360`, () => { expect(getAngleType(0)).toEqual("Invalid angle"); - expect(getAngleType(360)).toEqual("Invalid angle"); - }) \ No newline at end of file + expect(getAngleType(360)).toEqual("Invalid angle"); + expect(getAngleType(-20)).toEqual("Invalid angle"); + expect(getAngleType(560)).toEqual("Invalid angle"); +}); From c8cef5011fd4d1d39054fb3d6bcc596886356723 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Mar 2026 12:22:08 +0000 Subject: [PATCH 10/12] Implement the change to return the Numeric Value. --- .../rewrite-tests-with-jest/3-get-card-value.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js index d5775c8b67..0433b5dc63 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -11,7 +11,7 @@ test(`Should return 11 when given an ace card`, () => { // Suggestion: Group the remaining test data into these categories: // Number Cards (2-10) -test("Should return the correct value for number cards", () => { +test("Should return the numeric value for number cards", () => { expect(getCardValue("2♠")).toEqual(2); expect(getCardValue("10♦")).toEqual(10); }); From 2a0af312f1ce70bcd5de0f58cd5fe58c58deb5d0 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Mar 2026 12:59:40 +0000 Subject: [PATCH 11/12] Implement test for strings in the Invalid cards --- .../rewrite-tests-with-jest/3-get-card-value.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js index 0433b5dc63..9d9bed4c6c 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -16,7 +16,6 @@ test("Should return the numeric value for number cards", () => { expect(getCardValue("10♦")).toEqual(10); }); - // Face Cards (J, Q, K) test("Should return 10 for face cards (J, Q, K)", () => { expect(getCardValue("J♠")).toEqual(10); @@ -24,14 +23,14 @@ test("Should return 10 for face cards (J, Q, K)", () => { expect(getCardValue("K♠")).toEqual(10); }); - // Invalid Cards test("Should throw an error for invalid cards", () => { expect(() => getCardValue(null)).toThrow(); expect(() => getCardValue(undefined)).toThrow(); -}) + expect(() => getCardValue("11")).toThrow(); + expect(() => getCardValue("happy")).toThrow(); +}); // To learn how to test whether a function throws an error as expected in Jest, // please refer to the Jest documentation: // https://jestjs.io/docs/expect#tothrowerror - From c2ce7b83772fd116d841f6d31a237f3b17b0f75b Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Mar 2026 13:16:24 +0000 Subject: [PATCH 12/12] Effect changes --- .../rewrite-tests-with-jest/2-is-proper-fraction.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js index b519fcb675..1e454fc070 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -11,19 +11,19 @@ test(`should return false when denominator is zero`, () => { // Case 2: positive proper fractions -test(`should return true for positive proper fractions (numerator < denominator)`, () => { +test(`should return true when |numerator| < |denominator|`, () => { expect(isProperFraction(1, 2)).toEqual(true); expect(isProperFraction(2, 4)).toEqual(true); }) // Case 3: negative proper fractions -test(`should return true for negative proper fractions (numerator < denominator)`, () => { +test(`should return true when |numerator| < |denominator|`, () => { expect(isProperFraction(-1, -2)).toEqual(true); expect(isProperFraction(-2, -4)).toEqual(true); }) // Case 4: improper fractions (numerator >= denominator) -test(`should return false for improper fractions`, () => { +test(`should return false when |numerator| >= |denominator|`, () => { expect(isProperFraction(4, 2)).toEqual(false); expect(isProperFraction(4, 4)).toEqual(false); expect(isProperFraction(-6, 4)).toEqual(false);