From c66e7d421bad812db4e43b61ad823e5dbeed2f8b Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Wed, 4 Mar 2026 03:07:41 +0000 Subject: [PATCH 1/8] Implement getAngleType and add assertion tests --- .../implement/1-get-angle-type.js | 50 ++++++++++++++++++- 1 file changed, 49 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..fad06a6483 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,35 @@ // execute the code to ensure all tests pass. function getAngleType(angle) { - // TODO: Implement this function + // Check invalid angles first + if (angle <= 0 || angle >= 360) { + return "Invalid angle"; + } + + // Acute angle + if (angle > 0 && angle < 90) { + return "Acute angle"; + } + + // Right angle + if (angle === 90) { + return "Right angle"; + } + + // Obtuse angle + if (angle > 90 && angle < 180) { + return "Obtuse angle"; + } + + // Straight angle + if (angle === 180) { + return "Straight angle"; + } + + // Reflex 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 +63,23 @@ function assertEquals(actualOutput, targetOutput) { // Example: Identify Right Angles const right = getAngleType(90); assertEquals(right, "Right angle"); + +// Acute angle tests +assertEquals(getAngleType(30), "Acute angle"); +assertEquals(getAngleType(1), "Acute angle"); + +// Obtuse angle tests +assertEquals(getAngleType(120), "Obtuse angle"); +assertEquals(getAngleType(179), "Obtuse angle"); + +// Straight angle test +assertEquals(getAngleType(180), "Straight angle"); + +// Reflex angle tests +assertEquals(getAngleType(270), "Reflex angle"); +assertEquals(getAngleType(359), "Reflex angle"); + +// Invalid angle tests +assertEquals(getAngleType(0), "Invalid angle"); +assertEquals(getAngleType(360), "Invalid angle"); +assertEquals(getAngleType(-20), "Invalid angle"); \ No newline at end of file From 2c53190fb573e4b9453c87036580ef0d297d8012 Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Wed, 4 Mar 2026 03:09:55 +0000 Subject: [PATCH 2/8] Implement isProperFraction and add assertion tests --- .../implement/2-is-proper-fraction.js | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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..dd6ae1200a 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,17 @@ // execute the code to ensure all tests pass. function isProperFraction(numerator, denominator) { - // TODO: Implement this function + // A fraction with denominator 0 is invalid + if (denominator === 0) { + return false; + } + + // A proper fraction has absolute numerator smaller than absolute denominator + if (Math.abs(numerator) < Math.abs(denominator)) { + return true; + } + + return false; } // The line below allows us to load the isProperFraction function into tests in other files. @@ -31,3 +41,19 @@ function assertEquals(actualOutput, targetOutput) { // Example: 1/2 is a proper fraction assertEquals(isProperFraction(1, 2), true); + +// Proper fractions +assertEquals(isProperFraction(3, 5), true); +assertEquals(isProperFraction(-2, 7), true); +assertEquals(isProperFraction(2, -7), true); + +// Improper fractions +assertEquals(isProperFraction(5, 5), false); +assertEquals(isProperFraction(7, 3), false); +assertEquals(isProperFraction(-8, 4), false); + +// Zero numerator +assertEquals(isProperFraction(0, 5), true); + +// Invalid fraction (denominator 0) +assertEquals(isProperFraction(2, 0), false); \ No newline at end of file From 433a8480cff7857b97f67034da12ce3c70d8b25e Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Wed, 4 Mar 2026 03:11:44 +0000 Subject: [PATCH 3/8] Implement getCardValue and add assertion tests for valid and invalid cards --- .../implement/3-get-card-value.js | 63 +++++++++++++++++-- 1 file changed, 59 insertions(+), 4 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..3a6ff8a612 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,35 @@ // execute the code to ensure all tests pass. function getCardValue(card) { - // TODO: Implement this function + const suits = ["♠", "♥", "♦", "♣"]; + + // Card must be a string + if (typeof card !== "string") { + throw new Error("Invalid card"); + } + + const suit = card.slice(-1); + const rank = card.slice(0, -1); + + if (!suits.includes(suit)) { + throw new Error("Invalid card"); + } + + if (rank === "A") { + return 11; + } + + if (["J", "Q", "K"].includes(rank)) { + return 10; + } + + const number = Number(rank); + + if (number >= 2 && number <= 10) { + return number; + } + + throw new Error("Invalid card"); } // The line below allows us to load the getCardValue function into tests in other files. @@ -38,15 +66,42 @@ function assertEquals(actualOutput, targetOutput) { } // TODO: Write tests to cover all outcomes, including throwing errors for invalid cards. -// Examples: + +// Number cards +assertEquals(getCardValue("2♠"), 2); assertEquals(getCardValue("9♠"), 9); +assertEquals(getCardValue("10♥"), 10); + +// Face cards +assertEquals(getCardValue("J♣"), 10); +assertEquals(getCardValue("Q♦"), 10); +assertEquals(getCardValue("K♦"), 10); + +// Ace +assertEquals(getCardValue("A♠"), 11); // Handling invalid cards try { getCardValue("invalid"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("1♠"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("11♠"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} - // This line will not be reached if an error is thrown as expected +try { + getCardValue("A"); console.error("Error was not thrown for invalid card"); } catch (e) {} -// What other invalid card cases can you think of? +try { + getCardValue("♠"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} \ No newline at end of file From 32baac96cb9d85c5f2153f60dd9f30375c3a6a88 Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Wed, 4 Mar 2026 03:27:16 +0000 Subject: [PATCH 4/8] Sprint 3: implement functions and rewrite tests using Jest --- .../1-get-angle-type.test.js | 25 +++++++++++++++++++ 1 file changed, 25 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..1a91e07649 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,32 @@ 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" for angles outside valid range`, () => { + expect(getAngleType(0)).toEqual("Invalid angle"); + expect(getAngleType(360)).toEqual("Invalid angle"); + expect(getAngleType(-10)).toEqual("Invalid angle"); +}); \ No newline at end of file From f7e112c0a5a36ab8b3af7cc13360591497cf2f50 Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Sun, 8 Mar 2026 23:30:06 +0000 Subject: [PATCH 5/8] Fix isProperFraction implementation and update tests --- .../implement/2-is-proper-fraction.js | 49 ++++++++++++------- .../2-is-proper-fraction.test.js | 38 ++++++++++++-- 2 files changed, 64 insertions(+), 23 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 dd6ae1200a..87d455cdc8 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 @@ -1,14 +1,18 @@ -// Implement a function isProperFraction, -// when given two numbers, a numerator and a denominator, it should return true if -// the given numbers form a proper fraction, and false otherwise. +// Implement a function isProperFraction. +// When given two numbers, a numerator and a denominator, it should return true +// if the given numbers form a proper fraction, and false otherwise. // Assumption: The parameters are valid numbers (not NaN or Infinity). -// Note: If you are unfamiliar with proper fractions, please look up its mathematical definition. +// Definition: +// A proper fraction is a fraction where: +// - the denominator is not zero +// - both numbers are non-negative +// - the numerator is smaller than the denominator // Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. +// After implementing the function, write tests to cover all cases +// and run the code to ensure all tests pass. function isProperFraction(numerator, denominator) { // A fraction with denominator 0 is invalid @@ -16,11 +20,17 @@ function isProperFraction(numerator, denominator) { return false; } - // A proper fraction has absolute numerator smaller than absolute denominator - if (Math.abs(numerator) < Math.abs(denominator)) { + // Negative values are not allowed + if (numerator < 0 || denominator < 0) { + return false; + } + + // A proper fraction must have numerator smaller than denominator + if (numerator < denominator) { return true; } + // All other cases are not proper fractions return false; } @@ -28,7 +38,7 @@ function isProperFraction(numerator, denominator) { // This will be useful in the "rewrite tests with jest" step. module.exports = isProperFraction; -// Here's our helper again +// Helper function for simple assertions in this file function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -36,24 +46,25 @@ function assertEquals(actualOutput, targetOutput) { ); } -// TODO: Write tests to cover all cases. -// What combinations of numerators and denominators should you test? +// Tests to cover different combinations of numerators and denominators // Example: 1/2 is a proper fraction assertEquals(isProperFraction(1, 2), true); -// Proper fractions +// Proper fractions (numerator smaller than denominator) assertEquals(isProperFraction(3, 5), true); -assertEquals(isProperFraction(-2, 7), true); -assertEquals(isProperFraction(2, -7), true); +assertEquals(isProperFraction(2, 7), true); -// Improper fractions +// Improper fractions (numerator greater than or equal to denominator) assertEquals(isProperFraction(5, 5), false); assertEquals(isProperFraction(7, 3), false); -assertEquals(isProperFraction(-8, 4), false); -// Zero numerator +// Negative numbers should return false +assertEquals(isProperFraction(-2, 7), false); +assertEquals(isProperFraction(2, -7), false); + +// Zero numerator is allowed if denominator is positive assertEquals(isProperFraction(0, 5), true); -// Invalid fraction (denominator 0) -assertEquals(isProperFraction(2, 0), false); \ No newline at end of file +// Invalid fraction (denominator is zero) +assertEquals(isProperFraction(2, 0), false); 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..03d39264fe 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 @@ -2,9 +2,39 @@ // We will use the same function, but write tests for it using Jest in this file. 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. +// These tests cover different combinations of values such as: +// positive numbers, negative numbers, zeros, and improper fractions. -// Special case: numerator is zero -test(`should return false when denominator is zero`, () => { - expect(isProperFraction(1, 0)).toEqual(false); +describe("isProperFraction", () => { + // Special case: denominator is zero + test("should return false when denominator is zero", () => { + expect(isProperFraction(1, 0)).toEqual(false); + }); + + // Special case: numerator is zero + test("should return true when numerator is zero and denominator is positive", () => { + expect(isProperFraction(0, 5)).toEqual(true); + }); + + // Proper fraction: numerator is positive and less than denominator + test("should return true for a proper fraction", () => { + expect(isProperFraction(1, 2)).toEqual(true); + expect(isProperFraction(3, 4)).toEqual(true); + }); + + // Improper fraction: numerator is greater than or equal to denominator + test("should return false for an improper fraction", () => { + expect(isProperFraction(5, 4)).toEqual(false); + expect(isProperFraction(4, 4)).toEqual(false); + }); + + // Negative numerator + test("should return false when numerator is negative", () => { + expect(isProperFraction(-1, 2)).toEqual(false); + }); + + // Negative denominator + test("should return false when denominator is negative", () => { + expect(isProperFraction(1, -2)).toEqual(false); + }); }); From 3f0d84ec534577f7d944ff0e07830fe72563d69a Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Thu, 12 Mar 2026 00:45:54 +0000 Subject: [PATCH 6/8] Complete remaining Jest updates and tighten card rank validation --- .../implement/3-get-card-value.js | 29 ++++++++++++++----- .../3-get-card-value.test.js | 29 +++++++++++++++++++ 2 files changed, 50 insertions(+), 8 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 3a6ff8a612..9d4cc73cd6 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,17 +22,17 @@ // execute the code to ensure all tests pass. function getCardValue(card) { - const suits = ["♠", "♥", "♦", "♣"]; + const validSuits = ["♠", "♥", "♦", "♣"]; + const validNumberRanks = ["2", "3", "4", "5", "6", "7", "8", "9", "10"]; - // Card must be a string - if (typeof card !== "string") { + if (typeof card !== "string" || card.length < 2) { throw new Error("Invalid card"); } const suit = card.slice(-1); const rank = card.slice(0, -1); - if (!suits.includes(suit)) { + if (!validSuits.includes(suit)) { throw new Error("Invalid card"); } @@ -44,10 +44,8 @@ function getCardValue(card) { return 10; } - const number = Number(rank); - - if (number >= 2 && number <= 10) { - return number; + if (validNumberRanks.includes(rank)) { + return Number(rank); } throw new Error("Invalid card"); @@ -104,4 +102,19 @@ try { try { getCardValue("♠"); console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("0x02♠"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("2.1♠"); + console.error("Error was not thrown for invalid card"); +} catch (e) {} + +try { + getCardValue("0002♠"); + console.error("Error was not thrown for invalid card"); } catch (e) {} \ No newline at end of file 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..477d0cc398 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 @@ -18,3 +18,32 @@ test(`Should return 11 when given an ace card`, () => { // please refer to the Jest documentation: // https://jestjs.io/docs/expect#tothrowerror +// Case 2: Number cards +test("should return the numeric value when given a valid number card", () => { + expect(getCardValue("2♠")).toEqual(2); + expect(getCardValue("9♠")).toEqual(9); + expect(getCardValue("10♥")).toEqual(10); +}); + +// Case 3: Face cards +test("should return 10 when given a face card", () => { + expect(getCardValue("J♣")).toEqual(10); + expect(getCardValue("Q♦")).toEqual(10); + expect(getCardValue("K♥")).toEqual(10); +}); + +// Case 4: Invalid cards +test("should throw an error for invalid card strings", () => { + expect(() => getCardValue("invalid")).toThrow(); + expect(() => getCardValue("1♠")).toThrow(); + expect(() => getCardValue("11♠")).toThrow(); + expect(() => getCardValue("A")).toThrow(); + expect(() => getCardValue("♠")).toThrow(); +}); + +// Case 5: Invalid numeric literal strings +test("should throw an error for strings that JavaScript can coerce to numbers but are not valid card ranks", () => { + expect(() => getCardValue("0x02♠")).toThrow(); + expect(() => getCardValue("2.1♠")).toThrow(); + expect(() => getCardValue("0002♠")).toThrow(); +}); From 3965407a99447f9a989dad1ce19c3cbf17f49535 Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Thu, 12 Mar 2026 02:58:34 +0000 Subject: [PATCH 7/8] Refine proper fraction comments and clarify invalid angle test description --- .../implement/2-is-proper-fraction.js | 45 ++++++++----------- .../1-get-angle-type.test.js | 8 ++-- 2 files changed, 22 insertions(+), 31 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 87d455cdc8..38bd1b896d 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 @@ -1,36 +1,31 @@ -// Implement a function isProperFraction. -// When given two numbers, a numerator and a denominator, it should return true -// if the given numbers form a proper fraction, and false otherwise. +// Implement a function isProperFraction, +// when given two numbers, a numerator and a denominator, it should return true if +// the given numbers form a proper fraction, and false otherwise. // Assumption: The parameters are valid numbers (not NaN or Infinity). -// Definition: -// A proper fraction is a fraction where: -// - the denominator is not zero -// - both numbers are non-negative -// - the numerator is smaller than the denominator +// Note: If you are unfamiliar with proper fractions, please look up its mathematical definition. // Acceptance criteria: -// After implementing the function, write tests to cover all cases -// and run the code to ensure all tests pass. +// After you have implemented the function, write tests to cover all the cases, and +// execute the code to ensure all tests pass. function isProperFraction(numerator, denominator) { - // A fraction with denominator 0 is invalid + // A fraction with denominator 0 is invalid. if (denominator === 0) { return false; } - // Negative values are not allowed + // For this implementation, proper fractions are positive fractions + // where the numerator is smaller than the denominator. if (numerator < 0 || denominator < 0) { return false; } - // A proper fraction must have numerator smaller than denominator if (numerator < denominator) { return true; } - // All other cases are not proper fractions return false; } @@ -38,7 +33,7 @@ function isProperFraction(numerator, denominator) { // This will be useful in the "rewrite tests with jest" step. module.exports = isProperFraction; -// Helper function for simple assertions in this file +// Here's our helper again function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -46,25 +41,21 @@ function assertEquals(actualOutput, targetOutput) { ); } -// Tests to cover different combinations of numerators and denominators +// 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 fractions (numerator smaller than denominator) +// Proper fractions assertEquals(isProperFraction(3, 5), true); -assertEquals(isProperFraction(2, 7), true); +assertEquals(isProperFraction(0, 5), true); -// Improper fractions (numerator greater than or equal to denominator) +// Improper fractions assertEquals(isProperFraction(5, 5), false); assertEquals(isProperFraction(7, 3), false); -// Negative numbers should return false -assertEquals(isProperFraction(-2, 7), false); -assertEquals(isProperFraction(2, -7), false); - -// Zero numerator is allowed if denominator is positive -assertEquals(isProperFraction(0, 5), true); - -// Invalid fraction (denominator is zero) +// Invalid fractions assertEquals(isProperFraction(2, 0), false); +assertEquals(isProperFraction(-1, 2), false); +assertEquals(isProperFraction(1, -2), false); \ No newline at end of file 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 1a91e07649..056a3e5338 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 @@ -6,7 +6,7 @@ const getAngleType = require("../implement/1-get-angle-type"); // including boundary and invalid cases. // Case 1: Acute angles -test(`should return "Acute angle" when (0 < angle < 90)`, () => { +test(`should return "Acute angle" when 0 < angle < 90`, () => { // Test various acute angles, including boundary cases expect(getAngleType(1)).toEqual("Acute angle"); expect(getAngleType(45)).toEqual("Acute angle"); @@ -19,7 +19,7 @@ test(`should return "Right angle" when angle is exactly 90`, () => { }); // Case 3: Obtuse angles -test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { +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"); @@ -31,14 +31,14 @@ test(`should return "Straight angle" when angle is exactly 180`, () => { }); // Case 5: Reflex angles -test(`should return "Reflex angle" when (180 < angle < 360)`, () => { +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" for angles outside valid range`, () => { +test(`should return "Invalid angle" for angles less than or equal to 0, or greater than or equal to 360`, () => { expect(getAngleType(0)).toEqual("Invalid angle"); expect(getAngleType(360)).toEqual("Invalid angle"); expect(getAngleType(-10)).toEqual("Invalid angle"); From 79c63daee05e1b1cd427bfd7dc153418c77b95c4 Mon Sep 17 00:00:00 2001 From: Richard Frimpong Date: Thu, 12 Mar 2026 03:39:52 +0000 Subject: [PATCH 8/8] Trigger metadata check for PR title