From 6f5bc6a27b90043c064a55db9e91094989bb4cd2 Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 22 Feb 2026 18:22:52 +0200 Subject: [PATCH 01/12] tests were added to cover edge cases --- .../implement/1-get-angle-type.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) 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..de026b1f90 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 @@ -16,6 +16,19 @@ function getAngleType(angle) { // TODO: Implement this function + if (angle > 0 && angle < 90) { + return "Acute angle"; + } else if (angle === 90) { + return "Right angle"; + } else if (angle > 90 && angle < 180) { + return "Obtuse angle"; + } else if (angle === 180) { + return "Straight angle"; + } else if (angle > 180 && angle < 360) { + return "Reflex angle"; + } else { + return "Invalid angle"; + } } // The line below allows us to load the getAngleType function into tests in other files. @@ -35,3 +48,25 @@ 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(135); +assertEquals(obtuse, "Obtuse angle"); + +const straight = getAngleType(180); +assertEquals(straight, "Straight angle"); + +const reflex = getAngleType(270); +assertEquals(reflex, "Reflex angle"); + +const invalid = getAngleType(-45); +assertEquals(invalid, "Invalid angle"); +assertEquals(getAngleType(0), "Invalid angle"); +assertEquals(getAngleType(89), "Acute angle"); +assertEquals(getAngleType(91), "Obtuse angle"); +assertEquals(getAngleType(179), "Obtuse angle"); +assertEquals(getAngleType(181), "Reflex angle"); +assertEquals(getAngleType(359), "Reflex angle"); +assertEquals(getAngleType(360), "Invalid angle"); From 0de9751b167e1f7ddf354e162dfc60358fbdd37f Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 23 Feb 2026 21:49:50 +0200 Subject: [PATCH 02/12] Add i ProperFraction function with tests --- .../implement/2-is-proper-fraction.js | 11 +++++++++-- 1 file changed, 9 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..da921ebe6a 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,9 +11,10 @@ // 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. // This will be useful in the "rewrite tests with jest" step. module.exports = isProperFraction; @@ -31,3 +32,9 @@ function assertEquals(actualOutput, targetOutput) { // Example: 1/2 is a proper fraction assertEquals(isProperFraction(1, 2), true); +assertEquals(isProperFraction(2, 1), false); +assertEquals(isProperFraction(-1, 2), true); +assertEquals(isProperFraction(1, -2), true); +assertEquals(isProperFraction(-1, -2), true); +assertEquals(isProperFraction(0, 2), true); +assertEquals(isProperFraction(2, 0), false); From b4dc07eaaa18cd86e632deb282d8ba7ecea6390e Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 23 Feb 2026 22:20:16 +0200 Subject: [PATCH 03/12] feat: implement getCardValue and cover all edge cases with tests --- .../implement/3-get-card-value.js | 68 ++++++++++++++++++- 1 file changed, 66 insertions(+), 2 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 c7559e787e..6881b14e82 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,49 @@ // execute the code to ensure all tests pass. function getCardValue(card) { - // TODO: Implement this function + const validRanks = [ + "A", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "J", + "Q", + "K", + ]; + const validSuits = ["♠", "♥", "♦", "♣"]; + + if (typeof card !== "string") { + throw new Error("Invalid card"); + } + + if (card.length < 2) { + throw new Error("Invalid card"); + } + + const rank = card.substring(0, card.length - 1); + const suit = card.substring(card.length - 1); + + if (!validRanks.includes(rank)) { + throw new Error("Invalid card"); + } + + if (!validSuits.includes(suit)) { + throw new Error("Invalid card"); + } + + if (rank === "A") { + return 11; + } else if (rank === "J" || rank === "Q" || rank === "K") { + return 10; + } else { + return parseInt(rank); + } } // The line below allows us to load the getCardValue function into tests in other files. @@ -40,7 +82,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("J♦"), 10); +assertEquals(getCardValue("Q♣"), 10); +assertEquals(getCardValue("K♦"), 10); // Handling invalid cards try { getCardValue("invalid"); @@ -50,3 +95,22 @@ try { } catch (e) {} // What other invalid card cases can you think of? +assertEquals(getCardValue("A♣"), 11); +assertEquals(getCardValue("J♥"), 10); +assertEquals(getCardValue("Q♦"), 10); +assertEquals(getCardValue("K♠"), 10); + +try { + getCardValue("A"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("invalid"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("2♠♣"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} From 9b97ed057a739a55016c05e3ef03c4bbb17a9f3a Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Thu, 12 Mar 2026 06:19:51 +0200 Subject: [PATCH 04/12] test: add Jest tests for getAngleType function --- Project-CLI-Treasure-Hunt | 1 + .../implement/1-get-angle-type.js | 10 +++---- .../1-get-angle-type.test.js | 27 ++++++++++++++++--- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 160000 Project-CLI-Treasure-Hunt diff --git a/Project-CLI-Treasure-Hunt b/Project-CLI-Treasure-Hunt new file mode 160000 index 0000000000..2f622599e0 --- /dev/null +++ b/Project-CLI-Treasure-Hunt @@ -0,0 +1 @@ +Subproject commit 2f622599e09fc28147949f59bcb6892ff6721548 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 de026b1f90..26da0a0ea5 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,9 @@ // 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 > 0 && angle < 90) { return "Acute angle"; } else if (angle === 90) { @@ -35,8 +37,7 @@ function getAngleType(angle) { // This will be useful in the "rewrite tests with jest" step. module.exports = getAngleType; -// This helper function is written to make our assertions easier to read. -// If the actual output matches the target output, the test will pass +// Helper function for testing function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -44,8 +45,7 @@ function assertEquals(actualOutput, targetOutput) { ); } -// TODO: Write tests to cover all cases, including boundary and invalid cases. -// Example: Identify Right Angles +// Tests const right = getAngleType(90); assertEquals(right, "Right angle"); 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..49df7ee071 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 @@ -2,9 +2,6 @@ // We will use the same function, but write tests for it using Jest in this file. const getAngleType = require("../implement/1-get-angle-type"); -// TODO: Write tests in Jest syntax to cover all cases/outcomes, -// including boundary and invalid cases. - // Case 1: Acute angles test(`should return "Acute angle" when (0 < angle < 90)`, () => { // Test various acute angles, including boundary cases @@ -14,7 +11,31 @@ 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(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(359)).toEqual("Reflex angle"); +}); + // Case 6: Invalid angles +test(`should return "Invalid angle" when angle is negative`, () => { + expect(getAngleType(-1)).toEqual("Invalid angle"); +}); +test(`should return "Invalid angle" when angle is 360 or greater`, () => { + expect(getAngleType(360)).toEqual("Invalid angle"); +}); From 7a644362a69dfa5415d2e10cb10eae1dc298153b Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Thu, 12 Mar 2026 06:50:41 +0200 Subject: [PATCH 05/12] test: complete Jest tests for isProperFraction and ensure all cases pass --- .../implement/2-is-proper-fraction.js | 15 +++++++++-- .../2-is-proper-fraction.test.js | 26 ++++++++++++++++++- 2 files changed, 38 insertions(+), 3 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 da921ebe6a..972ea4472a 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,10 +11,21 @@ // execute the code to ensure all tests pass. function isProperFraction(numerator, denominator) { - if (denominator === 0) return false; + if (denominator === 0) { + return false; // A fraction with a zero denominator is undefined, so we return false. + } + + if (numerator === 0) { + return true; // A fraction with a zero numerator is a proper fraction (0/denominator). + } + if (numerator < 0 && denominator > 0) { + return false; + // Negative numerator, positive denominator + } return Math.abs(numerator) < Math.abs(denominator); + + return numerator < denominator && numerator > 0 && denominator > 0; } -// // The line below allows us to load the isProperFraction function into tests in other files. // This will be useful in the "rewrite tests with jest" step. module.exports = isProperFraction; 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..23776762c0 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 @@ -4,7 +4,31 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); // TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories. -// Special case: numerator is zero +// Special case: denominator is zero test(`should return false when denominator is zero`, () => { expect(isProperFraction(1, 0)).toEqual(false); }); + +// Case: numerator is zero +test(`should return true when numerator is zero and denominator is positive`, () => { + expect(isProperFraction(0, 1)).toEqual(true); +}); +test("should return true when numerator is smaller than denominator and both are positive", () => { + expect(isProperFraction(1, 2)).toEqual(true); +}); + +test("should return false when numerator is equal to denominator", () => { + expect(isProperFraction(2, 2)).toEqual(false); +}); + +test("should return false when numerator is greater than denominator", () => { + expect(isProperFraction(3, 2)).toEqual(false); +}); + +test("should return false when numerator is negative", () => { + expect(isProperFraction(-1, 2)).toEqual(false); +}); + +test("should return true when both numerator and denominator are negative and numerator is smaller than denominator", () => { + expect(isProperFraction(-1, -2)).toEqual(true); +}); From 221bb71697c4f876d38e0382b0f620ecc20cd8c5 Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Thu, 12 Mar 2026 06:57:09 +0200 Subject: [PATCH 06/12] test: add Jest tests for getCardValue covering number, face, and invalid cards --- .../3-get-card-value.test.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 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 cf7f9dae2e..1516886b03 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,10 +11,23 @@ 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("5♥")).toEqual(5); + expect(getCardValue("10♦")).toEqual(10); +}); // Face Cards (J, Q, K) +test(`Should return 10 for face cards`, () => { + 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("1♠")).toThrow(); + expect(() => getCardValue("Z♣")).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 f99a296f072c416520d1171e10a203064c3f2677 Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Fri, 13 Mar 2026 14:13:08 +0200 Subject: [PATCH 07/12] fixed the change --- .../implement/2-is-proper-fraction.js | 10 ---------- 1 file changed, 10 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 972ea4472a..5852d7dec3 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 @@ -14,17 +14,7 @@ function isProperFraction(numerator, denominator) { if (denominator === 0) { return false; // A fraction with a zero denominator is undefined, so we return false. } - - if (numerator === 0) { - return true; // A fraction with a zero numerator is a proper fraction (0/denominator). - } - if (numerator < 0 && denominator > 0) { - return false; - // Negative numerator, positive denominator - } return Math.abs(numerator) < Math.abs(denominator); - - return numerator < denominator && numerator > 0 && denominator > 0; } // The line below allows us to load the isProperFraction function into tests in other files. // This will be useful in the "rewrite tests with jest" step. From a1aff3b280208c5fe2433ad834f618eba0810feb Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 15 Mar 2026 12:34:33 +0200 Subject: [PATCH 08/12] deleted the unwanted file --- Project-CLI-Treasure-Hunt | 1 - 1 file changed, 1 deletion(-) delete mode 160000 Project-CLI-Treasure-Hunt diff --git a/Project-CLI-Treasure-Hunt b/Project-CLI-Treasure-Hunt deleted file mode 160000 index 2f622599e0..0000000000 --- a/Project-CLI-Treasure-Hunt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2f622599e09fc28147949f59bcb6892ff6721548 From f10a8d4619e063699f3c7247f631a6a68d1dae0a Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 15 Mar 2026 13:08:50 +0200 Subject: [PATCH 09/12] Add boundary test for angle 0 in getAngleType tests --- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 6 ++++++ 1 file changed, 6 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 49df7ee071..536dc3c295 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 @@ -36,6 +36,12 @@ test(`should return "Reflex angle" when (180 < angle < 360)`, () => { test(`should return "Invalid angle" when angle is negative`, () => { expect(getAngleType(-1)).toEqual("Invalid angle"); }); +test(`should return "Invalid angle" when angle is 0`, () => { + expect(getAngleType(0)).toEqual("Invalid angle"); +}); test(`should return "Invalid angle" when angle is 360 or greater`, () => { expect(getAngleType(360)).toEqual("Invalid angle"); }); +test(`should return "Invalid angle" when angle is not a number`, () => { + expect(getAngleType("not a number")).toEqual("Invalid angle"); +}); From 98734bff56bd2235ddec31065d9f9599526bc23d Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 15 Mar 2026 13:16:56 +0200 Subject: [PATCH 10/12] refactor tests: use absolute value rule for proper fractions --- .../2-is-proper-fraction.test.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 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 23776762c0..91e5a1bba1 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 @@ -5,18 +5,24 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); // TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories. // Special case: denominator is zero -test(`should return false when denominator is zero`, () => { +test("should return false when denominator is zero", () => { expect(isProperFraction(1, 0)).toEqual(false); }); // Case: numerator is zero -test(`should return true when numerator is zero and denominator is positive`, () => { +test("should return true when numerator is zero and denominator is positive", () => { expect(isProperFraction(0, 1)).toEqual(true); }); -test("should return true when numerator is smaller than denominator and both are positive", () => { + +// Proper fractions +test("should return true when abs(numerator) < abs(denominator)", () => { expect(isProperFraction(1, 2)).toEqual(true); + expect(isProperFraction(-1, 2)).toEqual(true); + expect(isProperFraction(1, -2)).toEqual(true); + expect(isProperFraction(-1, -2)).toEqual(true); }); +// Improper fractions test("should return false when numerator is equal to denominator", () => { expect(isProperFraction(2, 2)).toEqual(false); }); @@ -24,11 +30,3 @@ test("should return false when numerator is equal to denominator", () => { test("should return false when numerator is greater than denominator", () => { expect(isProperFraction(3, 2)).toEqual(false); }); - -test("should return false when numerator is negative", () => { - expect(isProperFraction(-1, 2)).toEqual(false); -}); - -test("should return true when both numerator and denominator are negative and numerator is smaller than denominator", () => { - expect(isProperFraction(-1, -2)).toEqual(true); -}); From 71445dc0fbc212d39bb429a4b122a2daac01365d Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 15 Mar 2026 13:46:45 +0200 Subject: [PATCH 11/12] removed unnecessary invalid input tests --- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 3 --- 1 file changed, 3 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 536dc3c295..9f836de670 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 @@ -42,6 +42,3 @@ test(`should return "Invalid angle" when angle is 0`, () => { test(`should return "Invalid angle" when angle is 360 or greater`, () => { expect(getAngleType(360)).toEqual("Invalid angle"); }); -test(`should return "Invalid angle" when angle is not a number`, () => { - expect(getAngleType("not a number")).toEqual("Invalid angle"); -}); From 362f6241e4e338d1b9e0211dd4156ce8dd857b5a Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Sun, 15 Mar 2026 13:56:41 +0200 Subject: [PATCH 12/12] Improve isProperFraction Jest tests - Added tests for proper fractions using abs(numerator) < abs(denominator) - Added tests for improper fractions using abs(numerator) >= abs(denominator) - Covered positive, negative, and zero cases - Added test for denominator equal to zero --- .../2-is-proper-fraction.test.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 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 91e5a1bba1..a75a23a7c1 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 @@ -16,17 +16,15 @@ test("should return true when numerator is zero and denominator is positive", () // Proper fractions test("should return true when abs(numerator) < abs(denominator)", () => { - expect(isProperFraction(1, 2)).toEqual(true); - expect(isProperFraction(-1, 2)).toEqual(true); - expect(isProperFraction(1, -2)).toEqual(true); - expect(isProperFraction(-1, -2)).toEqual(true); + expect(isProperFraction(1, 2)).toBe(true); + expect(isProperFraction(-1, 2)).toBe(true); + expect(isProperFraction(1, -2)).toBe(true); + expect(isProperFraction(-1, -2)).toBe(true); }); // Improper fractions -test("should return false when numerator is equal to denominator", () => { - expect(isProperFraction(2, 2)).toEqual(false); -}); - -test("should return false when numerator is greater than denominator", () => { - expect(isProperFraction(3, 2)).toEqual(false); +test("should return false when abs(numerator) >= abs(denominator)", () => { + expect(isProperFraction(2, 2)).toBe(false); + expect(isProperFraction(3, 2)).toBe(false); + expect(isProperFraction(-3, 2)).toBe(false); });