From c1ebe1fc6020bc32f380aeb5b6b962539bd2cc59 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Tue, 25 Aug 2026 16:24:20 +0100 Subject: [PATCH 01/14] update cowsay using command line argument --- challenges/challenge-cowsay-two/solution1.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/challenges/challenge-cowsay-two/solution1.js b/challenges/challenge-cowsay-two/solution1.js index a7f2416b3..fde835b38 100644 --- a/challenges/challenge-cowsay-two/solution1.js +++ b/challenges/challenge-cowsay-two/solution1.js @@ -7,6 +7,11 @@ // 1. Accept arguments // how will you accept arguments? +if (process.argv.length<3) { + console.error(`Usage: ${process.argv[0].split("/").slice(-1)} ${process.argv[1].split("/").slice(-1)} STRING`); + console.error(` e.g.: ${process.argv[0].split("/").slice(-1)} ${process.argv[1].split("/").slice(-1)} 'Mooooo'`); + process.exit(1); +} // 2. Make supplies for our speech bubble @@ -18,13 +23,23 @@ let saying = ''; function cowsay(saying) { // how will you make the speech bubble contain the text? + saying = (saying=="" ? "Mooooo" : saying); + console.log(` ${topLine.repeat(saying.length+2)} `); + console.log(`< ${saying} >`); + console.log(` ${bottomLine.repeat(saying.length+2)} `); // where will the cow picture go? + console.log(" \\ ^__^ "); + console.log(" \\ (oo)\\_______ "); + console.log(" (__)\\ )\\/\\"); + console.log(" ||----w | "); + console.log(" || || "); // how will you account for the parameter being empty? - + console.log(''); } //4. Pipe argument into cowsay function and return a cow // how will you log this to the console? +cowsay(process.argv.slice(2).join(" ")); \ No newline at end of file From f10382e54bd6117eb633e0c93ed63694f4a7ef02 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Tue, 25 Aug 2026 16:24:37 +0100 Subject: [PATCH 02/14] update cowsay using command line interface --- challenges/challenge-cowsay-two/solution2.js | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/challenges/challenge-cowsay-two/solution2.js b/challenges/challenge-cowsay-two/solution2.js index 8aca8572c..40c4904ea 100644 --- a/challenges/challenge-cowsay-two/solution2.js +++ b/challenges/challenge-cowsay-two/solution2.js @@ -5,14 +5,37 @@ // ================= // 1. Make a command line interface. +import readline from 'node:readline'; + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, +}); // 2. Make supplies for our speech bubble +let topLine = '_'; +let bottomLine = '-'; +let saying = ''; // 3. Make a cow that takes a string const cow = (saying) => { // how did you make the cow before? + saying = (saying=="" ? "Mooooo" : saying); + console.log(` ${topLine.repeat(saying.length+2)} `); + console.log(`< ${saying} >`); + console.log(` ${bottomLine.repeat(saying.length+2)} `); + console.log(" \\ ^__^ "); + console.log(" \\ (oo)\\_______ "); + console.log(" (__)\\ )\\/\\"); + console.log(" ||----w | "); + console.log(" || || "); + console.log(''); } // 4. Use readline to get a string from the terminal -// (with a prompt so it's clearer what we want) \ No newline at end of file +// (with a prompt so it's clearer what we want) +rl.question("What does the cow say? ", answer => { + cow(answer); + rl.close(); +}); \ No newline at end of file From cf287687d6bcb7e66c4dfc04a1a6b2ee26ddfec6 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 00:02:46 +0100 Subject: [PATCH 03/14] insert the main photo and thumbnails --- challenges/challenge-weather-app/index.html | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/challenges/challenge-weather-app/index.html b/challenges/challenge-weather-app/index.html index b1add346a..7da1da5b6 100644 --- a/challenges/challenge-weather-app/index.html +++ b/challenges/challenge-weather-app/index.html @@ -44,6 +44,41 @@

+ From afbfac8854628538d0bd91f0b74b6ed999beb025 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 02:01:40 +0100 Subject: [PATCH 04/14] Stretch goals --- .../challenge-weather-app/assets/globals.css | 3 ++- challenges/challenge-weather-app/index.html | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/challenges/challenge-weather-app/assets/globals.css b/challenges/challenge-weather-app/assets/globals.css index c9742ea5c..7e6457a27 100644 --- a/challenges/challenge-weather-app/assets/globals.css +++ b/challenges/challenge-weather-app/assets/globals.css @@ -37,7 +37,8 @@ body { font-size: 14px; background: center center no-repeat; background-size: contain; - color: #333; + background-color: #333; + color: #ccc; } a { diff --git a/challenges/challenge-weather-app/index.html b/challenges/challenge-weather-app/index.html index 7da1da5b6..fcf223601 100644 --- a/challenges/challenge-weather-app/index.html +++ b/challenges/challenge-weather-app/index.html @@ -46,34 +46,54 @@

+ + \ No newline at end of file From a81ddeac69d9a6aa9834fda5c314d0034a0b044a Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 17:24:04 +0100 Subject: [PATCH 06/14] unit testing calculator --- .../katas-tdd/calculator/calculator.js | 24 +++++++++++++++ .../katas-tdd/calculator/calculator.test.js | 30 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 challenges/unit-testing/katas-tdd/calculator/calculator.js create mode 100644 challenges/unit-testing/katas-tdd/calculator/calculator.test.js diff --git a/challenges/unit-testing/katas-tdd/calculator/calculator.js b/challenges/unit-testing/katas-tdd/calculator/calculator.js new file mode 100644 index 000000000..96dca2398 --- /dev/null +++ b/challenges/unit-testing/katas-tdd/calculator/calculator.js @@ -0,0 +1,24 @@ +function add(numbers) { + let nums = numbers.split(","); + let negs = []; + let sum = 0; + + for (let i=0; i1000 ? 0 : num); + } + } + + if (negs.length>0) { + throw new Error(`negatives not allowed: ${negs.join(",")}`); + } + + return sum; +} + +module.exports = add; \ No newline at end of file diff --git a/challenges/unit-testing/katas-tdd/calculator/calculator.test.js b/challenges/unit-testing/katas-tdd/calculator/calculator.test.js new file mode 100644 index 000000000..1ee6c0511 --- /dev/null +++ b/challenges/unit-testing/katas-tdd/calculator/calculator.test.js @@ -0,0 +1,30 @@ +let add = require("./calculator"); + +test("for an empty string it will return 0", function () { + expect(add("")).toEqual(0); +}); + +test("for single number string it will return the number", function () { + expect(add("5")).toEqual(5); + expect(add("0")).toEqual(0); +}); + +test("for an unknown amount of numbers string it will return the sum of them", function () { + expect(add("3,6")).toEqual(9); + expect(add("3,5,0,6")).toEqual(14); +}); + +test("for numbers bigger than 1000 string it should be ignored", function () { + expect(add("2,1001")).toEqual(2); + expect(add("1001,1001")).toEqual(0); +}); + +test("with a negative number string it will throw an error", function () { + expect(() => {add("1,4,-1");}).toThrow(new Error("negatives not allowed: -1")); + expect(() => {add("1,-4,1");}).toThrow(new Error("negatives not allowed: -4")); + expect(() => {add("-1,4,1");}).toThrow(new Error("negatives not allowed: -1")); + expect(() => {add("1,-4,-1");}).toThrow(new Error("negatives not allowed: -4,-1")); + expect(() => {add("-1,-4,1");}).toThrow(new Error("negatives not allowed: -1,-4")); + expect(() => {add("-1,4,-1");}).toThrow(new Error("negatives not allowed: -1,-1")); + expect(() => {add("-1,-4,-1");}).toThrow(new Error("negatives not allowed: -1,-4,-1")); +}); \ No newline at end of file From 5633b21cfa0b0021f63a5b3aec332714a3927084 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 17:46:47 +0100 Subject: [PATCH 07/14] unit testing password verifier --- .../password-verifier/password-verifier.js | 17 ++++++++++++++++ .../password-verifier.test.js | 20 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 challenges/unit-testing/katas-tdd/password-verifier/password-verifier.js create mode 100644 challenges/unit-testing/katas-tdd/password-verifier/password-verifier.test.js diff --git a/challenges/unit-testing/katas-tdd/password-verifier/password-verifier.js b/challenges/unit-testing/katas-tdd/password-verifier/password-verifier.js new file mode 100644 index 000000000..4afe52ccd --- /dev/null +++ b/challenges/unit-testing/katas-tdd/password-verifier/password-verifier.js @@ -0,0 +1,17 @@ +function verify(password) { + const uppercases = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); + const numbers = "0123456789".split(""); + let hasUppercase = false; + let hasNumber = false; + + if (password!=null && password.length>=8) { + for (let i=0; i Date: Wed, 26 Aug 2026 18:02:18 +0100 Subject: [PATCH 08/14] unit testing convert to old roman --- .../roman-numerals/convert-to-old-roman.js | 20 +++++++++++- .../convert-to-old-roman.test.js | 32 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.js b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.js index f7f0d06df..410a3269d 100644 --- a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.js +++ b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.js @@ -1,3 +1,21 @@ -function convertToOldRoman(n) {} +function convertToOldRoman(n) { + let roman = ""; + + roman += "M".repeat(Math.floor(n/1000)); + n = n%1000; + roman += "D".repeat(Math.floor(n/500)); + n = n%500; + roman += "C".repeat(Math.floor(n/100)); + n = n%100; + roman += "L".repeat(Math.floor(n/50)); + n = n%50; + roman += "X".repeat(Math.floor(n/10)); + n = n%10; + roman += "V".repeat(Math.floor(n/5)); + n = n%5; + roman += "I".repeat(Math.floor(n)); + + return roman; +} module.exports = convertToOldRoman; diff --git a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js index b9a43869e..79efc1ba1 100644 --- a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js +++ b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js @@ -4,4 +4,36 @@ test("returns I if passed 1 as an argument", function () { // Arrange // Act // Assert + expect(convertToOldRoman(1)).toEqual("I"); + expect(convertToOldRoman(2)).toEqual("II"); + expect(convertToOldRoman(3)).toEqual("III"); + expect(convertToOldRoman(4)).toEqual("IIII"); + expect(convertToOldRoman(5)).toEqual("V"); + expect(convertToOldRoman(6)).toEqual("VI"); + expect(convertToOldRoman(7)).toEqual("VII"); + expect(convertToOldRoman(8)).toEqual("VIII"); + expect(convertToOldRoman(9)).toEqual("VIIII"); + expect(convertToOldRoman(10)).toEqual("X"); + expect(convertToOldRoman(20)).toEqual("XX"); + expect(convertToOldRoman(30)).toEqual("XXX"); + expect(convertToOldRoman(40)).toEqual("XXXX"); + expect(convertToOldRoman(50)).toEqual("L"); + expect(convertToOldRoman(60)).toEqual("LX"); + expect(convertToOldRoman(70)).toEqual("LXX"); + expect(convertToOldRoman(80)).toEqual("LXXX"); + expect(convertToOldRoman(90)).toEqual("LXXXX"); + expect(convertToOldRoman(100)).toEqual("C"); + expect(convertToOldRoman(200)).toEqual("CC"); + expect(convertToOldRoman(300)).toEqual("CCC"); + expect(convertToOldRoman(400)).toEqual("CCCC"); + expect(convertToOldRoman(500)).toEqual("D"); + expect(convertToOldRoman(600)).toEqual("DC"); + expect(convertToOldRoman(700)).toEqual("DCC"); + expect(convertToOldRoman(800)).toEqual("DCCC"); + expect(convertToOldRoman(900)).toEqual("DCCCC"); + expect(convertToOldRoman(1000)).toEqual("M"); + expect(convertToOldRoman(2000)).toEqual("MM"); + expect(convertToOldRoman(3000)).toEqual("MMM"); + expect(convertToOldRoman(1234)).toEqual("MCCXXXIIII"); + expect(convertToOldRoman(2999)).toEqual("MMDCCCCLXXXXVIIII"); }); From 64543529ea6f6b17ca3d05c95f9b9f03dfbd5538 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:21:58 +0100 Subject: [PATCH 09/14] unit testing convert to new roman --- .../roman-numerals/convert-to-new-roman.js | 44 ++++++++++++++++++- .../convert-to-new-roman.test.js | 33 ++++++++++++++ .../convert-to-old-roman.test.js | 1 + 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.js b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.js index 0f2fe4b53..c21b4ce53 100644 --- a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.js +++ b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.js @@ -1,3 +1,45 @@ -function convertToNewRoman(n) {} +function convertToNewRoman(n) { + let roman = ""; + + roman += "M".repeat(Math.floor(n/1000)); + n = n%1000; + if (n>=900) { + roman += "CM"; + n = n-900; + } + roman += "D".repeat(Math.floor(n/500)); + n = n%500; + if (n>=400) { + roman += "CD"; + n = n-400; + } + roman += "C".repeat(Math.floor(n/100)); + n = n%100; + if (n>=90) { + roman += "XC"; + n = n-90; + } + roman += "L".repeat(Math.floor(n/50)); + n = n%50; + if (n>=40) { + roman += "XL"; + n = n-40; + } + roman += "X".repeat(Math.floor(n/10)); + n = n%10; + if (n>=9) { + roman += "IX"; + n = n-9; + } + roman += "V".repeat(Math.floor(n/5)); + n = n%5; + if (n>=4) { + roman += "IV"; + n = n-4; + } + roman += "I".repeat(Math.floor(n)); + + return roman; +} module.exports = convertToNewRoman; diff --git a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.test.js b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.test.js index ae49f7376..e5d351ef3 100644 --- a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.test.js +++ b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-new-roman.test.js @@ -4,4 +4,37 @@ test("returns I if passed 1 as an argument", function () { // Arrange // Act // Assert + expect(convertToNewRoman(1)).toEqual("I"); + expect(convertToNewRoman(2)).toEqual("II"); + expect(convertToNewRoman(3)).toEqual("III"); + expect(convertToNewRoman(4)).toEqual("IV"); + expect(convertToNewRoman(5)).toEqual("V"); + expect(convertToNewRoman(6)).toEqual("VI"); + expect(convertToNewRoman(7)).toEqual("VII"); + expect(convertToNewRoman(8)).toEqual("VIII"); + expect(convertToNewRoman(9)).toEqual("IX"); + expect(convertToNewRoman(10)).toEqual("X"); + expect(convertToNewRoman(20)).toEqual("XX"); + expect(convertToNewRoman(30)).toEqual("XXX"); + expect(convertToNewRoman(40)).toEqual("XL"); + expect(convertToNewRoman(50)).toEqual("L"); + expect(convertToNewRoman(60)).toEqual("LX"); + expect(convertToNewRoman(70)).toEqual("LXX"); + expect(convertToNewRoman(80)).toEqual("LXXX"); + expect(convertToNewRoman(90)).toEqual("XC"); + expect(convertToNewRoman(100)).toEqual("C"); + expect(convertToNewRoman(200)).toEqual("CC"); + expect(convertToNewRoman(300)).toEqual("CCC"); + expect(convertToNewRoman(400)).toEqual("CD"); + expect(convertToNewRoman(500)).toEqual("D"); + expect(convertToNewRoman(600)).toEqual("DC"); + expect(convertToNewRoman(700)).toEqual("DCC"); + expect(convertToNewRoman(800)).toEqual("DCCC"); + expect(convertToNewRoman(900)).toEqual("CM"); + expect(convertToNewRoman(1000)).toEqual("M"); + expect(convertToNewRoman(2000)).toEqual("MM"); + expect(convertToNewRoman(3000)).toEqual("MMM"); + expect(convertToNewRoman(1234)).toEqual("MCCXXXIV"); + expect(convertToNewRoman(2444)).toEqual("MMCDXLIV"); + expect(convertToNewRoman(2999)).toEqual("MMCMXCIX"); }); diff --git a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js index 79efc1ba1..9fef9a5ab 100644 --- a/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js +++ b/challenges/unit-testing/katas-tdd/roman-numerals/convert-to-old-roman.test.js @@ -35,5 +35,6 @@ test("returns I if passed 1 as an argument", function () { expect(convertToOldRoman(2000)).toEqual("MM"); expect(convertToOldRoman(3000)).toEqual("MMM"); expect(convertToOldRoman(1234)).toEqual("MCCXXXIIII"); + expect(convertToOldRoman(2444)).toEqual("MMCCCCXXXXIIII"); expect(convertToOldRoman(2999)).toEqual("MMDCCCCLXXXXVIIII"); }); From f58a6cf413bdfe2e561819fc682aaa89115ee92b Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:30:16 +0100 Subject: [PATCH 10/14] passing car sales tests --- .../passing-tests/car-sales/car-sales.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/challenges/unit-testing/passing-tests/car-sales/car-sales.js b/challenges/unit-testing/passing-tests/car-sales/car-sales.js index e8bb8511c..3c71d6865 100644 --- a/challenges/unit-testing/passing-tests/car-sales/car-sales.js +++ b/challenges/unit-testing/passing-tests/car-sales/car-sales.js @@ -1,3 +1,14 @@ -function sales(carsSold) {} +function sales(carsSold) { + totals = {}; + + for (let i of carsSold) { + if (!totals.hasOwnProperty(i.make)) { + totals[i.make] = 0; + } + totals[i.make] += i.price; + } + + return totals; +} module.exports = sales; From 5923ac0bc3ad30380497b913d5363d553ce74e79 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:33:08 +0100 Subject: [PATCH 11/14] passing factorial tests --- .../unit-testing/passing-tests/factorial/factorial.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/challenges/unit-testing/passing-tests/factorial/factorial.js b/challenges/unit-testing/passing-tests/factorial/factorial.js index fefa43684..a86de2fa9 100644 --- a/challenges/unit-testing/passing-tests/factorial/factorial.js +++ b/challenges/unit-testing/passing-tests/factorial/factorial.js @@ -8,6 +8,13 @@ // calculate and return the factorial of int // note: factorial of 0 is 1 -function factorial(int) {} +function factorial(int) { + if (int==0) { + return 1; + } + else { + return int*factorial(int-1); + } +} module.exports = factorial; From 00dda55668eee367248144b301c3c29e0b049f31 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:39:16 +0100 Subject: [PATCH 12/14] passing get average tests --- .../passing-tests/get-average/get-average.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/challenges/unit-testing/passing-tests/get-average/get-average.js b/challenges/unit-testing/passing-tests/get-average/get-average.js index b5588a578..5cf7c09fe 100644 --- a/challenges/unit-testing/passing-tests/get-average/get-average.js +++ b/challenges/unit-testing/passing-tests/get-average/get-average.js @@ -2,6 +2,15 @@ // return the average of all the numbers // be sure to exclude the strings -function average(numbers) {} +function average(numbers) { + let nums = numbers.filter(Number.isFinite); + let total = 0; + + for (let i of nums) { + total = total+i; + } + + return total/nums.length; +} module.exports = average; From a3519aec846b9fa8334e9ebecf43c68d3879cf90 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:46:26 +0100 Subject: [PATCH 13/14] writing largest number tests --- .../largest-number/largest-number.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/challenges/unit-testing/writing-tests/largest-number/largest-number.test.js b/challenges/unit-testing/writing-tests/largest-number/largest-number.test.js index ce674209e..9801a7265 100644 --- a/challenges/unit-testing/writing-tests/largest-number/largest-number.test.js +++ b/challenges/unit-testing/writing-tests/largest-number/largest-number.test.js @@ -4,6 +4,11 @@ test("returns largest number in array", function () { // Arrange // Act // Assert + expect(getLargestNumber([0])).toEqual(0); + expect(getLargestNumber([5])).toEqual(5); + expect(getLargestNumber([-5])).toEqual(-5); + expect(getLargestNumber([3, 21, 88, 4, 36])).toEqual(88); + expect(getLargestNumber([-3, -21, -88, -4, -36])).toEqual(-3); }); // example @@ -11,3 +16,8 @@ test("returns largest number in array", function () { // expected: 88; // also test that the original array hasn't changed +test("the original array hasn't changed", function () { + nums = [3, 21, 88, 4, 36]; + getLargestNumber(nums); + expect(nums).toEqual([3, 21, 88, 4, 36]); +}); From a436d11aebd03bde23363b88da346bb7c3be4f83 Mon Sep 17 00:00:00 2001 From: hackertainment <259196870+hackertainment@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:56:23 +0100 Subject: [PATCH 14/14] writing remove vowels in array tests --- .../remove-vowels/remove-vowels-in-array.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/challenges/unit-testing/writing-tests/remove-vowels/remove-vowels-in-array.test.js b/challenges/unit-testing/writing-tests/remove-vowels/remove-vowels-in-array.test.js index ee739e221..7af91a5f4 100644 --- a/challenges/unit-testing/writing-tests/remove-vowels/remove-vowels-in-array.test.js +++ b/challenges/unit-testing/writing-tests/remove-vowels/remove-vowels-in-array.test.js @@ -4,6 +4,13 @@ test("remove vowels from all words in array", function () { // Arrange // Act // Assert + expect(removeVowelsFromWords([])).toEqual([]); + expect(removeVowelsFromWords([""])).toEqual([""]); + expect(removeVowelsFromWords(["ABCDEFGHIJKLMNOPQRSTUVWXYZ"])).toEqual(["BCDFGHJKLMNPQRSTVWXYZ"]); + expect(removeVowelsFromWords(["abcdefghijklmnopqrstuvwxyz"])).toEqual(["bcdfghjklmnpqrstvwxyz"]); + expect(removeVowelsFromWords(["AEIOU", "aeiou"])).toEqual(["", ""]); + expect(removeVowelsFromWords(["BCDFGHJKLMNPQRSTVWXYZ", "bcdfghjklmnpqrstvwxyz"])).toEqual(["BCDFGHJKLMNPQRSTVWXYZ", "bcdfghjklmnpqrstvwxyz"]); + expect(removeVowelsFromWords(["Irina", "Etza", "Daniel"])).toEqual(["rn", "tz", "Dnl"]); }); // example