From c4261fd6cc2e157437074c1c5ff5953269072c25 Mon Sep 17 00:00:00 2001 From: russom Date: Sat, 4 Jul 2026 21:48:31 +0100 Subject: [PATCH 01/32] if condition created inside getAngleType function to evaluate the type of angle --- .../implement/1-get-angle-type.js | 13 +++++++++++++ 1 file changed, 13 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..d5b3343dfe 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. From 3331c94ff9f7b925e4464d1330dcb74114aca8be Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 7 Jul 2026 11:35:26 +0100 Subject: [PATCH 02/32] Test cases for Right and Obtuse angles created. --- .../1-get-angle-type.test.js | 13 +++++++++++++ 1 file changed, 13 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..a34b99e4fc 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,20 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { }); // Case 2: Right angle +test(`should return "Right angle" when (angle === 90)`, () => { + // Test various acute angles, including boundary cases + expect(getAngleType(89)).toEqual("Right angle"); + expect(getAngleType(90)).toEqual("Right angle"); + expect(getAngleType(91)).toEqual("Right angle"); +}); + // Case 3: Obtuse angles +test(`should return "Obtuse angle" when (angle > 90 && angle < 180)`, () => { + // Test various acute angles, including boundary cases + expect(getAngleType(91)).toEqual("Obtuse angle"); + expect(getAngleType(145)).toEqual("Obtuse angle"); + expect(getAngleType(179)).toEqual("Obtuse angle"); +}); // Case 4: Straight angle // Case 5: Reflex angles // Case 6: Invalid angles From d16b7fbf4000cacb5db4349033dc0f2486d495cf Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 7 Jul 2026 11:52:16 +0100 Subject: [PATCH 03/32] Test cases for Straight, Reflex and Invalid angles created and tested. --- .../1-get-angle-type.test.js | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 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 a34b99e4fc..98eaf63728 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 @@ -15,19 +15,36 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { // Case 2: Right angle test(`should return "Right angle" when (angle === 90)`, () => { - // Test various acute angles, including boundary cases - expect(getAngleType(89)).toEqual("Right angle"); + // Test Right angles. expect(getAngleType(90)).toEqual("Right angle"); - expect(getAngleType(91)).toEqual("Right angle"); }); // Case 3: Obtuse angles test(`should return "Obtuse angle" when (angle > 90 && angle < 180)`, () => { - // Test various acute angles, including boundary cases + // Test various Obtuse angles, including boundary cases expect(getAngleType(91)).toEqual("Obtuse angle"); expect(getAngleType(145)).toEqual("Obtuse angle"); expect(getAngleType(179)).toEqual("Obtuse angle"); }); + // Case 4: Straight angle +test(`should return "Straight angle" when (angle === 180)`, () => { + // Test Obtuse angles. + expect(getAngleType(180)).toEqual("Straight angle"); +}); + // Case 5: Reflex angles +test(`should return "Reflex angle" when (angle > 180 && angle < 360)`, () => { + // Test various Reflex angles, including boundary cases + expect(getAngleType(181)).toEqual("Reflex angle"); + expect(getAngleType(240)).toEqual("Reflex angle"); + expect(getAngleType(359)).toEqual("Reflex angle"); +}); + // Case 6: Invalid angles +test(`should return "Invalid angle" when (angle < 0 && angle > 360)`, () => { + // Test various Invalid angles that are less that 0 or above 360 degrees. + expect(getAngleType(0)).toEqual("Invalid angle"); + expect(getAngleType(361)).toEqual("Invalid angle"); +}); + From c3617ce7a981e97b8c9dfc080210d7455694e6b4 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 7 Jul 2026 12:10:49 +0100 Subject: [PATCH 04/32] More test cases added for invalid angles including negative numbers. --- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 11 ++++++----- 1 file changed, 6 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 98eaf63728..ca052f15aa 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 @@ -23,7 +23,7 @@ test(`should return "Right angle" when (angle === 90)`, () => { test(`should return "Obtuse angle" when (angle > 90 && angle < 180)`, () => { // Test various Obtuse angles, including boundary cases expect(getAngleType(91)).toEqual("Obtuse angle"); - expect(getAngleType(145)).toEqual("Obtuse angle"); + expect(getAngleType(135)).toEqual("Obtuse angle"); expect(getAngleType(179)).toEqual("Obtuse angle"); }); @@ -37,14 +37,15 @@ test(`should return "Straight angle" when (angle === 180)`, () => { test(`should return "Reflex angle" when (angle > 180 && angle < 360)`, () => { // Test various Reflex angles, including boundary cases expect(getAngleType(181)).toEqual("Reflex angle"); - expect(getAngleType(240)).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 < 0 && angle > 360)`, () => { - // Test various Invalid angles that are less that 0 or above 360 degrees. + // Test various Invalid angles that are less that are negative number, 0 and numbers that are above 360 degrees. + expect(getAngleType(-9)).toEqual("Invalid angle"); expect(getAngleType(0)).toEqual("Invalid angle"); - expect(getAngleType(361)).toEqual("Invalid angle"); + expect(getAngleType(360)).toEqual("Invalid angle"); + expect(getAngleType(450)).toEqual("Invalid angle"); }); - From 29fc3b32fe0f39ed3ef273b18cc6ccf01d4bcef6 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 7 Jul 2026 13:39:46 +0100 Subject: [PATCH 05/32] A return expression added into isProperFraction function --- .../implement/2-is-proper-fraction.js | 1 + 1 file changed, 1 insertion(+) 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..0985d513a8 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 @@ -12,6 +12,7 @@ function isProperFraction(numerator, denominator) { // TODO: Implement this function + return numerator > 0 && numerator < denominator; } // The line below allows us to load the isProperFraction function into tests in other files. From 94c1f50632d866ab5a48941fb15c606298a514e2 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 10:16:59 +0100 Subject: [PATCH 06/32] Test case for no occurrences scenario for a char in a str created. --- Sprint-3/2-practice-tdd/count.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-3/2-practice-tdd/count.test.js b/Sprint-3/2-practice-tdd/count.test.js index 179ea0ddf7..9f910f59ea 100644 --- a/Sprint-3/2-practice-tdd/count.test.js +++ b/Sprint-3/2-practice-tdd/count.test.js @@ -22,3 +22,10 @@ test("should count multiple occurrences of a character", () => { // And a character `char` that does not exist within `str`. // When the function is called with these inputs, // Then it should return 0, indicating that no occurrences of `char` were found. + +test("should return 0 when if no occurrences of a character", () => { + const str = "cc"; + const char = "b"; + const count = countChar(str, char); + expect(count).toEqual(0); +}); \ No newline at end of file From d4edc9da148f74ccad14cf0705163b3caa5fb968 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 10:18:12 +0100 Subject: [PATCH 07/32] Test case for handling 0 and negative counts of a char in a str created. --- Sprint-3/2-practice-tdd/repeat-str.test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Sprint-3/2-practice-tdd/repeat-str.test.js b/Sprint-3/2-practice-tdd/repeat-str.test.js index a3fc1196c4..a575a69b87 100644 --- a/Sprint-3/2-practice-tdd/repeat-str.test.js +++ b/Sprint-3/2-practice-tdd/repeat-str.test.js @@ -21,12 +21,33 @@ test("should repeat the string count times", () => { // When the repeatStr function is called with these inputs, // Then it should return the original `str` without repetition. +test("should repeat the string count times", () => { + const str = "hi"; + const count = 1; + const repeatedStr = repeatStr(str, count); + expect(repeatedStr).toEqual("hi"); +}); + // Case: Handle count of 0: // Given a target string `str` and a `count` equal to 0, // When the repeatStr function is called with these inputs, // Then it should return an empty string. +test("should repeat the string count times", () => { + const str = ""; + const count = 0; + const repeatedStr = repeatStr(str, count); + expect(repeatedStr).toEqual(""); +}); + // Case: Handle negative count: // Given a target string `str` and a negative integer `count`, // When the repeatStr function is called with these inputs, // Then it should throw an error, as negative counts are not valid. + +test("should repeat the string count times", () => { + const str = "hello"; + const count = -1; + const repeatedStr = repeatStr(str, count); + expect(repeatedStr).toEqual(""); +}); From e82f88c33c48e13e84e433949c5aedbcb938a182 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 10:19:50 +0100 Subject: [PATCH 08/32] Test cases for handling different ordinal numbers created. --- .../2-practice-tdd/get-ordinal-number.test.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Sprint-3/2-practice-tdd/get-ordinal-number.test.js b/Sprint-3/2-practice-tdd/get-ordinal-number.test.js index adfa58560f..cb9eaf84b3 100644 --- a/Sprint-3/2-practice-tdd/get-ordinal-number.test.js +++ b/Sprint-3/2-practice-tdd/get-ordinal-number.test.js @@ -18,3 +18,34 @@ test("should append 'st' for numbers ending with 1, except those ending with 11" expect(getOrdinalNumber(21)).toEqual("21st"); expect(getOrdinalNumber(131)).toEqual("131st"); }); + +test("should append 'nd' for numbers ending with 2", () => { + expect(getOrdinalNumber(2)).toEqual("2nd"); + expect(getOrdinalNumber(22)).toEqual("22nd"); + expect(getOrdinalNumber(132)).toEqual("132nd"); +}); + +test("should append 'rd' for numbers ending with 3", () => { + expect(getOrdinalNumber(3)).toEqual("3rd"); + expect(getOrdinalNumber(23)).toEqual("23rd"); + expect(getOrdinalNumber(133)).toEqual("133rd"); +}); + +test("should append 'th' for numbers ending with 4 -10", () => { + expect(getOrdinalNumber(4)).toEqual("4th"); + expect(getOrdinalNumber(7)).toEqual("7th"); + expect(getOrdinalNumber(10)).toEqual("10th"); +}); + +test("should append 'th' for numbers ending with 11 - 13", () => { + expect(getOrdinalNumber(11)).toEqual("11th"); + expect(getOrdinalNumber(12)).toEqual("12th"); + expect(getOrdinalNumber(13)).toEqual("13th"); +}); + +test("should append 'error' for invalid numbers", () => { + expect(getOrdinalNumber(0)).toEqual("error"); + expect(getOrdinalNumber(-1)).toEqual("error"); + expect(getOrdinalNumber(1.5)).toEqual("error"); + expect(getOrdinalNumber("5")).toEqual("error"); +}); \ No newline at end of file From 1fa6def41e0c4e5ac8074f48893680f1509a2c43 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 10:39:04 +0100 Subject: [PATCH 09/32] countChar function created to check for multiple occurrence of a char in a str. --- Sprint-3/2-practice-tdd/count.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Sprint-3/2-practice-tdd/count.js b/Sprint-3/2-practice-tdd/count.js index 95b6ebb7d4..1674e59c8d 100644 --- a/Sprint-3/2-practice-tdd/count.js +++ b/Sprint-3/2-practice-tdd/count.js @@ -1,5 +1,12 @@ function countChar(stringOfCharacters, findCharacter) { - return 5 -} + let count = 0; + for (let i = 0; i < stringOfCharacters; i++) { + if (stringOfCharacters[i] === findCharacter) { + count++; + } else { + count = 0; + } + } +} module.exports = countChar; From d37292b7ed4e2990319dbde7ee4e26cfc98e53a3 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 11:14:51 +0100 Subject: [PATCH 10/32] .length method added to count char in a str --- Sprint-3/2-practice-tdd/count.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sprint-3/2-practice-tdd/count.js b/Sprint-3/2-practice-tdd/count.js index 1674e59c8d..7b68a2487f 100644 --- a/Sprint-3/2-practice-tdd/count.js +++ b/Sprint-3/2-practice-tdd/count.js @@ -1,12 +1,14 @@ function countChar(stringOfCharacters, findCharacter) { let count = 0; - for (let i = 0; i < stringOfCharacters; i++) { + for (let i = 0; i < stringOfCharacters.length; i++) { if (stringOfCharacters[i] === findCharacter) { count++; } else { - count = 0; + return count; } } + return count; } +console.log(countChar("bbbbb", "b")); module.exports = countChar; From 82538915648f10748bf616bc94b55d0a2826b1b0 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 14:18:16 +0100 Subject: [PATCH 11/32] repeatStr function created to check count times is str repeated. --- Sprint-3/2-practice-tdd/repeat-str.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Sprint-3/2-practice-tdd/repeat-str.js b/Sprint-3/2-practice-tdd/repeat-str.js index 2af0a2cea7..4a9bd35d93 100644 --- a/Sprint-3/2-practice-tdd/repeat-str.js +++ b/Sprint-3/2-practice-tdd/repeat-str.js @@ -1,7 +1,15 @@ -function repeatStr() { +function repeatStr(str, count) { + if (count < 0) { + throw new Error("Error"); + } // Your implementation of this function must *not* call String.prototype.repeat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat). - // The goal is to re-implement that function, not to use it. - return "hellohellohello"; + //The goal is to re-implement that function, not to use it. + let repeatedStr = ""; + + for (let i = 0; i < count; i++) { + repeatedStr += str; + } + return repeatedStr; } module.exports = repeatStr; From 8979be1eadcbc009a0ef50558335af96f79fd52c Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 14 Jul 2026 14:23:19 +0100 Subject: [PATCH 12/32] Unnecessary code removed. --- Sprint-3/2-practice-tdd/count.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sprint-3/2-practice-tdd/count.js b/Sprint-3/2-practice-tdd/count.js index 7b68a2487f..0f92b6fe8b 100644 --- a/Sprint-3/2-practice-tdd/count.js +++ b/Sprint-3/2-practice-tdd/count.js @@ -4,11 +4,9 @@ function countChar(stringOfCharacters, findCharacter) { for (let i = 0; i < stringOfCharacters.length; i++) { if (stringOfCharacters[i] === findCharacter) { count++; - } else { - return count; } } return count; } -console.log(countChar("bbbbb", "b")); + module.exports = countChar; From 0e19677fe5ccd1149d96c089f26c6567157ae5dd Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 21 Jul 2026 10:33:57 +0100 Subject: [PATCH 13/32] Test case to handle negative numbers and throw an error fixed. --- Sprint-3/2-practice-tdd/repeat-str.test.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sprint-3/2-practice-tdd/repeat-str.test.js b/Sprint-3/2-practice-tdd/repeat-str.test.js index a575a69b87..23f16aace9 100644 --- a/Sprint-3/2-practice-tdd/repeat-str.test.js +++ b/Sprint-3/2-practice-tdd/repeat-str.test.js @@ -21,7 +21,7 @@ test("should repeat the string count times", () => { // When the repeatStr function is called with these inputs, // Then it should return the original `str` without repetition. -test("should repeat the string count times", () => { +test("should repeat the string count 1 time", () => { const str = "hi"; const count = 1; const repeatedStr = repeatStr(str, count); @@ -33,8 +33,8 @@ test("should repeat the string count times", () => { // When the repeatStr function is called with these inputs, // Then it should return an empty string. -test("should repeat the string count times", () => { - const str = ""; +test("should repeat the string 0 time", () => { + const str = "hello"; const count = 0; const repeatedStr = repeatStr(str, count); expect(repeatedStr).toEqual(""); @@ -45,9 +45,8 @@ test("should repeat the string count times", () => { // When the repeatStr function is called with these inputs, // Then it should throw an error, as negative counts are not valid. -test("should repeat the string count times", () => { +test("should throw an error", () => { const str = "hello"; const count = -1; - const repeatedStr = repeatStr(str, count); - expect(repeatedStr).toEqual(""); + expect(() => repeatedStr(str, count)).toThrow(); }); From 74d5e9f35d341bcd92843a4c5f9717575a264a38 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 21 Jul 2026 10:59:16 +0100 Subject: [PATCH 14/32] Function for first test case fir checking numbers ending with st implemented. --- Sprint-3/2-practice-tdd/get-ordinal-number.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sprint-3/2-practice-tdd/get-ordinal-number.js b/Sprint-3/2-practice-tdd/get-ordinal-number.js index f95d71db13..8226ab7654 100644 --- a/Sprint-3/2-practice-tdd/get-ordinal-number.js +++ b/Sprint-3/2-practice-tdd/get-ordinal-number.js @@ -1,5 +1,10 @@ function getOrdinalNumber(num) { - return "1st"; + const lastDigit = num % 10; + const lastTwoDigits = num % 100; + if (lastDigit === 1 && lastTwoDigits !== 11) { + return `${num}st`; + } + return `${num}th`; } module.exports = getOrdinalNumber; From 42025c9871c9280c3ff8816be88bf7728fdbf7c2 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 21 Jul 2026 11:06:29 +0100 Subject: [PATCH 15/32] A second if statement added into the function to check tests for numbers ending in nd. --- Sprint-3/2-practice-tdd/get-ordinal-number.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-3/2-practice-tdd/get-ordinal-number.js b/Sprint-3/2-practice-tdd/get-ordinal-number.js index 8226ab7654..d14137e7d2 100644 --- a/Sprint-3/2-practice-tdd/get-ordinal-number.js +++ b/Sprint-3/2-practice-tdd/get-ordinal-number.js @@ -4,6 +4,10 @@ function getOrdinalNumber(num) { if (lastDigit === 1 && lastTwoDigits !== 11) { return `${num}st`; } + if (lastDigit === 2 && lastTwoDigits !== 12) { + return `${num}nd`; + } + if return `${num}th`; } From ee69e69525de34c1e39d7f3b9d45eabcd5710606 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 21 Jul 2026 11:11:40 +0100 Subject: [PATCH 16/32] A third if statement added to test numbers with ending in rd --- Sprint-3/2-practice-tdd/get-ordinal-number.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-3/2-practice-tdd/get-ordinal-number.js b/Sprint-3/2-practice-tdd/get-ordinal-number.js index d14137e7d2..5ca0590890 100644 --- a/Sprint-3/2-practice-tdd/get-ordinal-number.js +++ b/Sprint-3/2-practice-tdd/get-ordinal-number.js @@ -7,7 +7,9 @@ function getOrdinalNumber(num) { if (lastDigit === 2 && lastTwoDigits !== 12) { return `${num}nd`; } - if + if (lastDigit === 3 && lastTwoDigits !== 13) { + return `${num}rd`; + } return `${num}th`; } From 3590fb10720aa805043cb4e56b7987f813e5d8d5 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 21 Jul 2026 11:27:07 +0100 Subject: [PATCH 17/32] An if statement added to the function to check if num is not negative or not a whole number or not a string first thing --- Sprint-3/2-practice-tdd/get-ordinal-number.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sprint-3/2-practice-tdd/get-ordinal-number.js b/Sprint-3/2-practice-tdd/get-ordinal-number.js index 5ca0590890..63e5698cfa 100644 --- a/Sprint-3/2-practice-tdd/get-ordinal-number.js +++ b/Sprint-3/2-practice-tdd/get-ordinal-number.js @@ -1,15 +1,18 @@ function getOrdinalNumber(num) { + if (num <= 0 || !Number.isInteger(num) || typeof num !== "number") { + return "error"; + } const lastDigit = num % 10; const lastTwoDigits = num % 100; if (lastDigit === 1 && lastTwoDigits !== 11) { return `${num}st`; } - if (lastDigit === 2 && lastTwoDigits !== 12) { + if (lastDigit === 2 && lastTwoDigits !== 12) { return `${num}nd`; } - if (lastDigit === 3 && lastTwoDigits !== 13) { - return `${num}rd`; - } + if (lastDigit === 3 && lastTwoDigits !== 13) { + return `${num}rd`; + } return `${num}th`; } From 2399760fc739718f4afc8482fc3f1902d076739a Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 28 Jul 2026 23:27:50 +0100 Subject: [PATCH 18/32] Redundant code removed --- Sprint-3/3-dead-code/exercise-1.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/Sprint-3/3-dead-code/exercise-1.js b/Sprint-3/3-dead-code/exercise-1.js index 4d09f15fa9..e51f0e5871 100644 --- a/Sprint-3/3-dead-code/exercise-1.js +++ b/Sprint-3/3-dead-code/exercise-1.js @@ -1,13 +1,10 @@ // Find the instances of unreachable and redundant code - remove them! // The sayHello function should continue to work for any reasonable input it's given. -let testName = "Jerry"; const greeting = "hello"; function sayHello(greeting, name) { - const greetingStr = greeting + ", " + name + "!"; return `${greeting}, ${name}!`; - console.log(greetingStr); } testName = "Aman"; From d99d5b90e97467d7200c90087a6129e42604a573 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 28 Jul 2026 23:40:23 +0100 Subject: [PATCH 19/32] Unused code removed --- Sprint-3/3-dead-code/exercise-2.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Sprint-3/3-dead-code/exercise-2.js b/Sprint-3/3-dead-code/exercise-2.js index 56d7887c4c..b1c2362d34 100644 --- a/Sprint-3/3-dead-code/exercise-2.js +++ b/Sprint-3/3-dead-code/exercise-2.js @@ -2,13 +2,8 @@ // The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable. const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"]; -const capitalisedPets = pets.map((pet) => pet.toUpperCase()); const petsStartingWithH = pets.filter((pet) => pet[0] === "h"); -function logPets(petsArr) { - petsArr.forEach((pet) => console.log(pet)); -} - function countAndCapitalisePets(petsArr) { const petCount = {}; From d3f4e1ae70d1f4bd5f6480f94354a1575d775f29 Mon Sep 17 00:00:00 2001 From: russom Date: Tue, 28 Jul 2026 23:50:22 +0100 Subject: [PATCH 20/32] Work committed without creating a new branch --- Sprint-3/3-dead-code/exercise-1.js | 3 +++ Sprint-3/3-dead-code/exercise-2.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Sprint-3/3-dead-code/exercise-1.js b/Sprint-3/3-dead-code/exercise-1.js index e51f0e5871..4d09f15fa9 100644 --- a/Sprint-3/3-dead-code/exercise-1.js +++ b/Sprint-3/3-dead-code/exercise-1.js @@ -1,10 +1,13 @@ // Find the instances of unreachable and redundant code - remove them! // The sayHello function should continue to work for any reasonable input it's given. +let testName = "Jerry"; const greeting = "hello"; function sayHello(greeting, name) { + const greetingStr = greeting + ", " + name + "!"; return `${greeting}, ${name}!`; + console.log(greetingStr); } testName = "Aman"; diff --git a/Sprint-3/3-dead-code/exercise-2.js b/Sprint-3/3-dead-code/exercise-2.js index b1c2362d34..56d7887c4c 100644 --- a/Sprint-3/3-dead-code/exercise-2.js +++ b/Sprint-3/3-dead-code/exercise-2.js @@ -2,8 +2,13 @@ // The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable. const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"]; +const capitalisedPets = pets.map((pet) => pet.toUpperCase()); const petsStartingWithH = pets.filter((pet) => pet[0] === "h"); +function logPets(petsArr) { + petsArr.forEach((pet) => console.log(pet)); +} + function countAndCapitalisePets(petsArr) { const petCount = {}; From ae0db8cbdbfeba7b5153d9f466fc5124b9b4b0eb Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 00:11:00 +0100 Subject: [PATCH 21/32] Files updated that were committed on the wrong branch --- .../implement/1-get-angle-type.js | 13 -------- .../implement/2-is-proper-fraction.js | 1 - .../1-get-angle-type.test.js | 31 ------------------- .../3-get-card-value.test.js | 1 - 4 files changed, 46 deletions(-) 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 d5b3343dfe..9e05a871e2 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,19 +16,6 @@ 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. 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 0985d513a8..970cb9b641 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 @@ -12,7 +12,6 @@ function isProperFraction(numerator, denominator) { // TODO: Implement this function - return numerator > 0 && numerator < denominator; } // The line below allows us to load the isProperFraction function into tests in other files. 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 ca052f15aa..d777f348d3 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,38 +14,7 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { }); // Case 2: Right angle -test(`should return "Right angle" when (angle === 90)`, () => { - // Test Right angles. - expect(getAngleType(90)).toEqual("Right angle"); -}); - // Case 3: Obtuse angles -test(`should return "Obtuse angle" when (angle > 90 && angle < 180)`, () => { - // Test various Obtuse angles, including boundary cases - expect(getAngleType(91)).toEqual("Obtuse angle"); - expect(getAngleType(135)).toEqual("Obtuse angle"); - expect(getAngleType(179)).toEqual("Obtuse angle"); -}); - // Case 4: Straight angle -test(`should return "Straight angle" when (angle === 180)`, () => { - // Test Obtuse angles. - expect(getAngleType(180)).toEqual("Straight angle"); -}); - // Case 5: Reflex angles -test(`should return "Reflex angle" when (angle > 180 && angle < 360)`, () => { - // Test various Reflex angles, including boundary cases - 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 < 0 && angle > 360)`, () => { - // Test various Invalid angles that are less that are negative number, 0 and numbers that are above 360 degrees. - expect(getAngleType(-9)).toEqual("Invalid angle"); - expect(getAngleType(0)).toEqual("Invalid angle"); - expect(getAngleType(360)).toEqual("Invalid angle"); - expect(getAngleType(450)).toEqual("Invalid angle"); -}); 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..3bcaf403ad 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 @@ -17,4 +17,3 @@ test(`Should return 11 when given an ace card`, () => { // 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 c466f3fc5e3c05ae50b6493b85181419921c7fb4 Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 00:15:03 +0100 Subject: [PATCH 22/32] file removed from the wrong branch --- .../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 3bcaf403ad..71597b0a9d 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,4 +16,4 @@ test(`Should return 11 when given an ace card`, () => { // 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 +// https://jestjs.io/docs/expect#tothrowerror \ No newline at end of file From 2d60a0f1bb78c12fdd41664725879a6258047f09 Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 00:21:31 +0100 Subject: [PATCH 23/32] Branch updated --- .../1-implement-and-rewrite-tests/implement/1-get-angle-type.js | 2 +- .../implement/2-is-proper-fraction.js | 2 +- .../1-implement-and-rewrite-tests/implement/3-get-card-value.js | 2 +- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 2 +- .../rewrite-tests-with-jest/2-is-proper-fraction.test.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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..a5b70cc84b 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 @@ -34,4 +34,4 @@ function assertEquals(actualOutput, targetOutput) { // TODO: Write tests to cover all cases, including boundary and invalid cases. // Example: Identify Right Angles const right = getAngleType(90); -assertEquals(right, "Right angle"); +assertEquals(right, "Right angle"); \ No newline at end of file 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..1a17008f35 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 @@ -30,4 +30,4 @@ function assertEquals(actualOutput, targetOutput) { // What combinations of numerators and denominators should you test? // Example: 1/2 is a proper fraction -assertEquals(isProperFraction(1, 2), true); +assertEquals(isProperFraction(1, 2), true); \ No newline at end of file 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 ff5c532e1d..e15a1a31e0 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 @@ -51,4 +51,4 @@ try { console.log("Error thrown for invalid card 🎉"); } -// What other invalid card cases can you think of? +// What other invalid card cases can you think of? \ 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 d777f348d3..47038b83c7 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 @@ -17,4 +17,4 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { // Case 3: Obtuse angles // Case 4: Straight angle // Case 5: Reflex angles -// Case 6: Invalid angles +// Case 6: Invalid angles \ No newline at end of file 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..2fe397e033 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 @@ -7,4 +7,4 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); // Special case: numerator is zero test(`should return false when denominator is zero`, () => { expect(isProperFraction(1, 0)).toEqual(false); -}); +}); \ No newline at end of file From 9edf0299d52fc1740da509444f0df6f088a04996 Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 00:44:29 +0100 Subject: [PATCH 24/32] branch updated --- Sprint-3/2-practice-tdd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md index f7d82fe43d..0d87850d64 100644 --- a/Sprint-3/2-practice-tdd/README.md +++ b/Sprint-3/2-practice-tdd/README.md @@ -10,4 +10,4 @@ Recommended order: 1. `count.test.js` 1. `repeat-str.test.js` -1. `get-ordinal-number.test.js` +1. `get-ordinal-number.test.js` \ No newline at end of file From 8662965d0b98acb3390de1b4b559ff6a6896a659 Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 01:06:46 +0100 Subject: [PATCH 25/32] branch updated --- .../1-implement-and-rewrite-tests/implement/3-get-card-value.js | 2 +- 1 file changed, 1 insertion(+), 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 e15a1a31e0..ff5c532e1d 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 @@ -51,4 +51,4 @@ try { console.log("Error thrown for invalid card 🎉"); } -// What other invalid card cases can you think of? \ No newline at end of file +// What other invalid card cases can you think of? From 954144dbffc185d7596afe07770f208770427873 Mon Sep 17 00:00:00 2001 From: russom Date: Wed, 29 Jul 2026 19:28:07 +0100 Subject: [PATCH 26/32] branch updated --- .../rewrite-tests-with-jest/1-get-angle-type.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 47038b83c7..d777f348d3 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 @@ -17,4 +17,4 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { // Case 3: Obtuse angles // Case 4: Straight angle // Case 5: Reflex angles -// Case 6: Invalid angles \ No newline at end of file +// Case 6: Invalid angles From 475c68f10a96d25aac3109cd4bad5dd3c8e77128 Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 21:40:57 +0100 Subject: [PATCH 27/32] k --- .../rewrite-tests-with-jest/3-get-card-value.test.js | 3 ++- 1 file changed, 2 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 71597b0a9d..883260b40f 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,4 +16,5 @@ test(`Should return 11 when given an ace card`, () => { // 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 \ No newline at end of file +// https://jestjs.io/docs/expect#tothrowerror +//k \ No newline at end of file From 457f1a7c46560f0b34bfdead4c6f0cfa58cd6247 Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 22:04:34 +0100 Subject: [PATCH 28/32] files removed --- .../implement/1-get-angle-type.js | 37 ------------------- .../implement/2-is-proper-fraction.js | 33 ----------------- .../2-is-proper-fraction.test.js | 10 ----- .../3-get-card-value.test.js | 20 ---------- Sprint-3/2-practice-tdd/README.md | 13 ------- 5 files changed, 113 deletions(-) delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js delete mode 100644 Sprint-3/2-practice-tdd/README.md 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 deleted file mode 100644 index a5b70cc84b..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js +++ /dev/null @@ -1,37 +0,0 @@ -// Implement a function getAngleType -// -// When given an angle in degrees, it should return a string indicating the type of angle: -// - "Acute angle" for angles greater than 0° and less than 90° -// - "Right angle" for exactly 90° -// - "Obtuse angle" for angles greater than 90° and less than 180° -// - "Straight angle" for exactly 180° -// - "Reflex angle" for angles greater than 180° and less than 360° -// - "Invalid angle" for angles outside the valid range. - -// Assumption: The parameter is a valid number. (You do not need to handle non-numeric inputs.) - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - -function getAngleType(angle) { - // TODO: Implement this function -} - -// The line below allows us to load the getAngleType function into tests in other files. -// 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 -function assertEquals(actualOutput, targetOutput) { - console.assert( - actualOutput === targetOutput, - `Expected ${actualOutput} to equal ${targetOutput}` - ); -} - -// TODO: Write tests to cover all cases, including boundary and invalid cases. -// Example: Identify Right Angles -const right = getAngleType(90); -assertEquals(right, "Right angle"); \ No newline at end of file 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 deleted file mode 100644 index 1a17008f35..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -// Acceptance criteria: -// 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) { - // TODO: Implement this function -} - -// 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; - -// Here's our helper again -function assertEquals(actualOutput, targetOutput) { - console.assert( - actualOutput === targetOutput, - `Expected ${actualOutput} to equal ${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); \ No newline at end of file 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 deleted file mode 100644 index 2fe397e033..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ /dev/null @@ -1,10 +0,0 @@ -// This statement loads the isProperFraction function you wrote in the implement directory. -// 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. - -// Special case: numerator is zero -test(`should return false when denominator is zero`, () => { - expect(isProperFraction(1, 0)).toEqual(false); -}); \ 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 deleted file mode 100644 index 883260b40f..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ /dev/null @@ -1,20 +0,0 @@ -// This statement loads the getCardValue function you wrote in the implement directory. -// We will use the same function, but write tests for it using Jest in this file. -const getCardValue = require("../implement/3-get-card-value"); - -// TODO: Write tests in Jest syntax to cover all possible outcomes. - -// Case 1: Ace (A) -test(`Should return 11 when given an ace card`, () => { - expect(getCardValue("A♠")).toEqual(11); -}); - -// Suggestion: Group the remaining test data into these categories: -// Number Cards (2-10) -// Face Cards (J, Q, K) -// Invalid Cards - -// 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 -//k \ No newline at end of file diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md deleted file mode 100644 index 0d87850d64..0000000000 --- a/Sprint-3/2-practice-tdd/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Practice TDD - -In this section you'll practice this key skill of building up your program test first. - -Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress. - -Write the tests _before_ the code that will make them pass. - -Recommended order: - -1. `count.test.js` -1. `repeat-str.test.js` -1. `get-ordinal-number.test.js` \ No newline at end of file From a19d12925f72893875b42fea797dafa7d337340a Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 22:04:47 +0100 Subject: [PATCH 29/32] files updated --- .../implement/1-get-angle-type.js | 37 +++++++++++++++++++ .../implement/2-is-proper-fraction.js | 33 +++++++++++++++++ .../2-is-proper-fraction.test.js | 10 +++++ .../3-get-card-value.test.js | 20 ++++++++++ Sprint-3/2-practice-tdd/README.md | 13 +++++++ 5 files changed, 113 insertions(+) create mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js create mode 100644 Sprint-3/2-practice-tdd/README.md 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 new file mode 100644 index 0000000000..a5b70cc84b --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js @@ -0,0 +1,37 @@ +// Implement a function getAngleType +// +// When given an angle in degrees, it should return a string indicating the type of angle: +// - "Acute angle" for angles greater than 0° and less than 90° +// - "Right angle" for exactly 90° +// - "Obtuse angle" for angles greater than 90° and less than 180° +// - "Straight angle" for exactly 180° +// - "Reflex angle" for angles greater than 180° and less than 360° +// - "Invalid angle" for angles outside the valid range. + +// Assumption: The parameter is a valid number. (You do not need to handle non-numeric inputs.) + +// Acceptance criteria: +// After you have implemented the function, write tests to cover all the cases, and +// execute the code to ensure all tests pass. + +function getAngleType(angle) { + // TODO: Implement this function +} + +// The line below allows us to load the getAngleType function into tests in other files. +// 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 +function assertEquals(actualOutput, targetOutput) { + console.assert( + actualOutput === targetOutput, + `Expected ${actualOutput} to equal ${targetOutput}` + ); +} + +// TODO: Write tests to cover all cases, including boundary and invalid cases. +// Example: Identify Right Angles +const right = getAngleType(90); +assertEquals(right, "Right angle"); \ No newline at end of file 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 new file mode 100644 index 0000000000..1a17008f35 --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -0,0 +1,33 @@ +// 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. + +// Acceptance criteria: +// 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) { + // TODO: Implement this function +} + +// 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; + +// Here's our helper again +function assertEquals(actualOutput, targetOutput) { + console.assert( + actualOutput === targetOutput, + `Expected ${actualOutput} to equal ${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); \ No newline at end of file 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 new file mode 100644 index 0000000000..2fe397e033 --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -0,0 +1,10 @@ +// This statement loads the isProperFraction function you wrote in the implement directory. +// 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. + +// Special case: numerator is zero +test(`should return false when denominator is zero`, () => { + expect(isProperFraction(1, 0)).toEqual(false); +}); \ 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 new file mode 100644 index 0000000000..883260b40f --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -0,0 +1,20 @@ +// This statement loads the getCardValue function you wrote in the implement directory. +// We will use the same function, but write tests for it using Jest in this file. +const getCardValue = require("../implement/3-get-card-value"); + +// TODO: Write tests in Jest syntax to cover all possible outcomes. + +// Case 1: Ace (A) +test(`Should return 11 when given an ace card`, () => { + expect(getCardValue("A♠")).toEqual(11); +}); + +// Suggestion: Group the remaining test data into these categories: +// Number Cards (2-10) +// Face Cards (J, Q, K) +// Invalid Cards + +// 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 +//k \ No newline at end of file diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md new file mode 100644 index 0000000000..0d87850d64 --- /dev/null +++ b/Sprint-3/2-practice-tdd/README.md @@ -0,0 +1,13 @@ +# Practice TDD + +In this section you'll practice this key skill of building up your program test first. + +Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress. + +Write the tests _before_ the code that will make them pass. + +Recommended order: + +1. `count.test.js` +1. `repeat-str.test.js` +1. `get-ordinal-number.test.js` \ No newline at end of file From 17367af69aa858589b59ab154489702e713473a1 Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 22:09:44 +0100 Subject: [PATCH 30/32] Remove untracked files from branch --- .../implement/1-get-angle-type.js | 37 ------------------- .../implement/2-is-proper-fraction.js | 33 ----------------- .../2-is-proper-fraction.test.js | 10 ----- .../3-get-card-value.test.js | 20 ---------- Sprint-3/2-practice-tdd/README.md | 13 ------- 5 files changed, 113 deletions(-) delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js delete mode 100644 Sprint-3/2-practice-tdd/README.md 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 deleted file mode 100644 index a5b70cc84b..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js +++ /dev/null @@ -1,37 +0,0 @@ -// Implement a function getAngleType -// -// When given an angle in degrees, it should return a string indicating the type of angle: -// - "Acute angle" for angles greater than 0° and less than 90° -// - "Right angle" for exactly 90° -// - "Obtuse angle" for angles greater than 90° and less than 180° -// - "Straight angle" for exactly 180° -// - "Reflex angle" for angles greater than 180° and less than 360° -// - "Invalid angle" for angles outside the valid range. - -// Assumption: The parameter is a valid number. (You do not need to handle non-numeric inputs.) - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - -function getAngleType(angle) { - // TODO: Implement this function -} - -// The line below allows us to load the getAngleType function into tests in other files. -// 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 -function assertEquals(actualOutput, targetOutput) { - console.assert( - actualOutput === targetOutput, - `Expected ${actualOutput} to equal ${targetOutput}` - ); -} - -// TODO: Write tests to cover all cases, including boundary and invalid cases. -// Example: Identify Right Angles -const right = getAngleType(90); -assertEquals(right, "Right angle"); \ No newline at end of file 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 deleted file mode 100644 index 1a17008f35..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -// Acceptance criteria: -// 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) { - // TODO: Implement this function -} - -// 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; - -// Here's our helper again -function assertEquals(actualOutput, targetOutput) { - console.assert( - actualOutput === targetOutput, - `Expected ${actualOutput} to equal ${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); \ No newline at end of file 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 deleted file mode 100644 index 2fe397e033..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ /dev/null @@ -1,10 +0,0 @@ -// This statement loads the isProperFraction function you wrote in the implement directory. -// 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. - -// Special case: numerator is zero -test(`should return false when denominator is zero`, () => { - expect(isProperFraction(1, 0)).toEqual(false); -}); \ 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 deleted file mode 100644 index 883260b40f..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ /dev/null @@ -1,20 +0,0 @@ -// This statement loads the getCardValue function you wrote in the implement directory. -// We will use the same function, but write tests for it using Jest in this file. -const getCardValue = require("../implement/3-get-card-value"); - -// TODO: Write tests in Jest syntax to cover all possible outcomes. - -// Case 1: Ace (A) -test(`Should return 11 when given an ace card`, () => { - expect(getCardValue("A♠")).toEqual(11); -}); - -// Suggestion: Group the remaining test data into these categories: -// Number Cards (2-10) -// Face Cards (J, Q, K) -// Invalid Cards - -// 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 -//k \ No newline at end of file diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md deleted file mode 100644 index 0d87850d64..0000000000 --- a/Sprint-3/2-practice-tdd/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Practice TDD - -In this section you'll practice this key skill of building up your program test first. - -Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress. - -Write the tests _before_ the code that will make them pass. - -Recommended order: - -1. `count.test.js` -1. `repeat-str.test.js` -1. `get-ordinal-number.test.js` \ No newline at end of file From 356a851f59d4620a59d8bed50d5745a034ab0372 Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 22:22:35 +0100 Subject: [PATCH 31/32] files changed --- .../implement/1-get-angle-type.js | 37 +++++++++++++++++++ .../implement/2-is-proper-fraction.js | 33 +++++++++++++++++ .../2-is-proper-fraction.test.js | 10 +++++ .../3-get-card-value.test.js | 20 ++++++++++ Sprint-3/2-practice-tdd/README.md | 13 +++++++ 5 files changed, 113 insertions(+) create mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js create mode 100644 Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js create mode 100644 Sprint-3/2-practice-tdd/README.md 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 new file mode 100644 index 0000000000..a5b70cc84b --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js @@ -0,0 +1,37 @@ +// Implement a function getAngleType +// +// When given an angle in degrees, it should return a string indicating the type of angle: +// - "Acute angle" for angles greater than 0° and less than 90° +// - "Right angle" for exactly 90° +// - "Obtuse angle" for angles greater than 90° and less than 180° +// - "Straight angle" for exactly 180° +// - "Reflex angle" for angles greater than 180° and less than 360° +// - "Invalid angle" for angles outside the valid range. + +// Assumption: The parameter is a valid number. (You do not need to handle non-numeric inputs.) + +// Acceptance criteria: +// After you have implemented the function, write tests to cover all the cases, and +// execute the code to ensure all tests pass. + +function getAngleType(angle) { + // TODO: Implement this function +} + +// The line below allows us to load the getAngleType function into tests in other files. +// 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 +function assertEquals(actualOutput, targetOutput) { + console.assert( + actualOutput === targetOutput, + `Expected ${actualOutput} to equal ${targetOutput}` + ); +} + +// TODO: Write tests to cover all cases, including boundary and invalid cases. +// Example: Identify Right Angles +const right = getAngleType(90); +assertEquals(right, "Right angle"); \ No newline at end of file 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 new file mode 100644 index 0000000000..1a17008f35 --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -0,0 +1,33 @@ +// 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. + +// Acceptance criteria: +// 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) { + // TODO: Implement this function +} + +// 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; + +// Here's our helper again +function assertEquals(actualOutput, targetOutput) { + console.assert( + actualOutput === targetOutput, + `Expected ${actualOutput} to equal ${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); \ No newline at end of file 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 new file mode 100644 index 0000000000..2fe397e033 --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -0,0 +1,10 @@ +// This statement loads the isProperFraction function you wrote in the implement directory. +// 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. + +// Special case: numerator is zero +test(`should return false when denominator is zero`, () => { + expect(isProperFraction(1, 0)).toEqual(false); +}); \ 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 new file mode 100644 index 0000000000..883260b40f --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -0,0 +1,20 @@ +// This statement loads the getCardValue function you wrote in the implement directory. +// We will use the same function, but write tests for it using Jest in this file. +const getCardValue = require("../implement/3-get-card-value"); + +// TODO: Write tests in Jest syntax to cover all possible outcomes. + +// Case 1: Ace (A) +test(`Should return 11 when given an ace card`, () => { + expect(getCardValue("A♠")).toEqual(11); +}); + +// Suggestion: Group the remaining test data into these categories: +// Number Cards (2-10) +// Face Cards (J, Q, K) +// Invalid Cards + +// 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 +//k \ No newline at end of file diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md new file mode 100644 index 0000000000..0d87850d64 --- /dev/null +++ b/Sprint-3/2-practice-tdd/README.md @@ -0,0 +1,13 @@ +# Practice TDD + +In this section you'll practice this key skill of building up your program test first. + +Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress. + +Write the tests _before_ the code that will make them pass. + +Recommended order: + +1. `count.test.js` +1. `repeat-str.test.js` +1. `get-ordinal-number.test.js` \ No newline at end of file From 6f5a3e71c1db9570b0aac8cf94606876eb84fadb Mon Sep 17 00:00:00 2001 From: russom Date: Thu, 30 Jul 2026 22:26:58 +0100 Subject: [PATCH 32/32] Restore untouched files to match main --- .../1-implement-and-rewrite-tests/implement/1-get-angle-type.js | 2 +- .../implement/2-is-proper-fraction.js | 2 +- .../rewrite-tests-with-jest/2-is-proper-fraction.test.js | 2 +- .../rewrite-tests-with-jest/3-get-card-value.test.js | 2 +- Sprint-3/2-practice-tdd/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 a5b70cc84b..9e05a871e2 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 @@ -34,4 +34,4 @@ function assertEquals(actualOutput, targetOutput) { // TODO: Write tests to cover all cases, including boundary and invalid cases. // Example: Identify Right Angles const right = getAngleType(90); -assertEquals(right, "Right angle"); \ No newline at end of file +assertEquals(right, "Right angle"); 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 1a17008f35..970cb9b641 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 @@ -30,4 +30,4 @@ function assertEquals(actualOutput, targetOutput) { // What combinations of numerators and denominators should you test? // Example: 1/2 is a proper fraction -assertEquals(isProperFraction(1, 2), true); \ No newline at end of file +assertEquals(isProperFraction(1, 2), true); 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 2fe397e033..7f087b2ba1 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 @@ -7,4 +7,4 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); // Special case: numerator is zero test(`should return false when denominator is zero`, () => { expect(isProperFraction(1, 0)).toEqual(false); -}); \ 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 883260b40f..cf7f9dae2e 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 @@ -17,4 +17,4 @@ test(`Should return 11 when given an ace card`, () => { // 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 -//k \ No newline at end of file + diff --git a/Sprint-3/2-practice-tdd/README.md b/Sprint-3/2-practice-tdd/README.md index 0d87850d64..f7d82fe43d 100644 --- a/Sprint-3/2-practice-tdd/README.md +++ b/Sprint-3/2-practice-tdd/README.md @@ -10,4 +10,4 @@ Recommended order: 1. `count.test.js` 1. `repeat-str.test.js` -1. `get-ordinal-number.test.js` \ No newline at end of file +1. `get-ordinal-number.test.js`