From 6cc5fc041678d388137dd295532e66f32e6d2a11 Mon Sep 17 00:00:00 2001 From: aleksandrstarshynov Date: Tue, 4 Mar 2025 12:03:16 +0100 Subject: [PATCH 1/3] Oleksandr Starshynov week3 JavaScript --- .test-summary/TEST_SUMMARY.md | 13 +++++++ .../assignment/ex1-doubleEvenNumbers.test.js | 22 ++--------- .../Week3/assignment/ex2-mondaysWorth.test.js | 9 ++++- .../Week3/assignment/ex3-lemonAllergy.test.js | 23 +++--------- .../ex4-observable/ex4-observable.js | 8 ++-- .../Week3/assignment/ex5-wallet/index.js | 12 +++--- .../ex1-doubleEvenNumbers.test.report.txt | 13 +++++++ .../ex2-mondaysWorth.test.report.txt | 19 ++++++++++ .../ex3-lemonAllergy.test.report.txt | 37 +++++++++++++++++++ .../test-reports/ex4-observable.report.txt | 15 ++++++++ .../Week3/test-reports/ex5-wallet.report.txt | 17 +++++++++ 11 files changed, 140 insertions(+), 48 deletions(-) create mode 100644 .test-summary/TEST_SUMMARY.md create mode 100644 1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt create mode 100644 1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt create mode 100644 1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt create mode 100644 1-JavaScript/Week3/test-reports/ex4-observable.report.txt create mode 100644 1-JavaScript/Week3/test-reports/ex5-wallet.report.txt diff --git a/.test-summary/TEST_SUMMARY.md b/.test-summary/TEST_SUMMARY.md new file mode 100644 index 000000000..f65c79476 --- /dev/null +++ b/.test-summary/TEST_SUMMARY.md @@ -0,0 +1,13 @@ +## Test Summary + +**Mentors**: For more information on how to review homework assignments, please refer to the [Review Guide](https://github.com/HackYourFuture/mentors/blob/main/assignment-support/review-guide.md). + +### 1-JavaScript - Week3 + +| Exercise | Passed | Failed | ESLint | +|----------------------------|--------|--------|--------| +| ex1-doubleEvenNumbers.test | 1 | - | ✓ | +| ex2-mondaysWorth.test | 2 | - | ✓ | +| ex3-lemonAllergy.test | - | 3 | ✓ | +| ex4-observable | 3 | - | ✓ | +| ex5-wallet | 5 | - | ✓ | diff --git a/1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js b/1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js index ff706f8db..1819f47c5 100644 --- a/1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js +++ b/1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js @@ -1,25 +1,9 @@ -/*------------------------------------------------------------------------------ -Full description at: https://github.com/HackYourFuture/Assignments/tree/main/1-JavaScript/Week4#exercise-1-the-odd-ones-out - -The `doubleEvenNumbers` function returns only the even numbers in the array -passed as the `numbers` parameter and doubles them. - -Let's rewrite it (or _refactor_ it, as experienced developers would call it): - -- Using the `map` and `filter` functions, rewrite the function body of -`doubleEvenNumbers`. -------------------------------------------------------------------------------*/ // ! Function to be tested function doubleEvenNumbers(numbers) { - // TODO rewrite the function body using `map` and `filter`. - const newNumbers = []; - for (let i = 0; i < numbers.length; i++) { - if (numbers[i] % 2 === 0) { - newNumbers.push(numbers[i] * 2); - } + const evenNumbers = numbers.filter(num => num % 2 === 0); + const doubledNumbers = evenNumbers.map(num => num * 2); + return doubledNumbers; } - return newNumbers; -} // ! Unit test (using Jest) describe('js-wk3-ex1-doubleEvenNumbers', () => { diff --git a/1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js b/1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js index d4ce4b45e..8ff80189f 100644 --- a/1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js +++ b/1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js @@ -30,10 +30,15 @@ const mondayTasks = [ const hourlyRate = 25; -function computeEarnings(/* TODO parameter(s) go here */) { - // TODO complete this function +function computeEarnings(tasks, hourlyRate) { + const totalEarnings = tasks + .map(task => task.duration / 60 * hourlyRate) + .reduce((sum, earnings) => sum + earnings, 0); + return `€${totalEarnings.toFixed(2)}`; } +console.log(computeEarnings(mondayTasks, hourlyRate)); + // ! Unit tests (using Jest) describe('js-wk3-mondaysWorth', () => { test('computeEarnings should take two parameters', () => { diff --git a/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js b/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js index 8a11a5fad..b01f982af 100644 --- a/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js +++ b/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js @@ -1,19 +1,3 @@ -/*------------------------------------------------------------------------------ -Full description at: https://github.com/HackYourFuture/Assignments/tree/main/1-JavaScript/Week4#exercise-3-lemon-allergy - -Your mom bought you a basket of fruit, because you're doing so well in -HackYourFuture. How sweet of her! - -However, she forgot that you are allergic to lemons! Let's quickly dispose of -them before you get an attack. - -Complete the function called `sanitizeFruitBasket`: - -- It should take two parameters: an array of strings representing a fruit basket - to be sanitized and a string indicating the name of the fruit to be taken out. -- Use the `filter` array method to take out the unwanted fruit. -- Return a new array that contains the fruits without any lemons. -------------------------------------------------------------------------------*/ const fruitBasket = [ 'apple', 'lemon', @@ -24,9 +8,12 @@ const fruitBasket = [ 'lemon', ]; +const forbidden = 'lemon'; + // ! Function under test -function sanitizeFruitBasket(/* TODO parameter(s) go here */) { - // TODO complete this function +function sanitizeFruitBasket(fruitBasket, forbidden) { + const basket = fruitBasket.filter(fruit => fruit !== forbidden); + return basket; } // ! Unit tests (using Jest) diff --git a/1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.js b/1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.js index a729822bc..e05a7df6d 100644 --- a/1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.js +++ b/1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.js @@ -16,10 +16,12 @@ export function createObservable() { const subscribers = []; return { subscribe(subscriber) { - // TODO complete this function + subscribers.push(subscriber); }, notify(message) { - // TODO complete this function + subscribers.forEach(subscriber => { + subscriber(message); + }); }, }; -} +} \ No newline at end of file diff --git a/1-JavaScript/Week3/assignment/ex5-wallet/index.js b/1-JavaScript/Week3/assignment/ex5-wallet/index.js index 215446ca8..d9a7d0e9e 100644 --- a/1-JavaScript/Week3/assignment/ex5-wallet/index.js +++ b/1-JavaScript/Week3/assignment/ex5-wallet/index.js @@ -23,7 +23,7 @@ function createWallet(name, cash = 0) { function transferInto(wallet, amount) { console.log( `Transferring ${eurosFormatter.format(amount)} from ${name} to ${ - wallet.name + wallet.getName() }` ); const withdrawnAmount = withdraw(amount); @@ -75,7 +75,7 @@ const quiz = { b: 'cash, name', c: 'amount, this, wallet' }, - answer: '?', + answer: 'b', }, q2: { question: 'What is in the Call Stack, from top to bottom?', @@ -84,7 +84,7 @@ const quiz = { b: 'anonymous, transferInto', c: 'transferInto, anonymous' }, - answer: '?', + answer: 'c', }, q3: { question: 'What tooltip appears when hovering over the third debug button?', @@ -93,7 +93,7 @@ const quiz = { b: 'Step out of current function', c: 'Step' }, - answer: '?', + answer: 'a', }, q4: { question: 'What is displayed in the console?', @@ -102,7 +102,7 @@ const quiz = { b: 'Transferring € 50,00 from Jack to undefined', c: 'Transferring € 50,00 from Jack to Jane' }, - answer: '?', + answer: 'a', }, q5: { question: 'The owner of the wallet with insufficient funds is:', @@ -111,6 +111,6 @@ const quiz = { b: 'Joe', c: 'Jane' }, - answer: '?', + answer: 'c', }, }; diff --git a/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt new file mode 100644 index 000000000..2d603f4b5 --- /dev/null +++ b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt @@ -0,0 +1,13 @@ +*** Unit Test Error Report *** + + PASS 1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js + js-wk3-ex1-doubleEvenNumbers + ✅ doubleEvenNumbers should take the even numbers and double them (3 ms) + +Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: 1.414 s +Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex1-doubleEvenNumbers.test.js/i. +No linting errors detected. +No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt new file mode 100644 index 000000000..1ef9d109e --- /dev/null +++ b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt @@ -0,0 +1,19 @@ +*** Unit Test Error Report *** + +console.log + €187.50 + + at Object.log (1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js:40:9) + + PASS 1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js + js-wk3-mondaysWorth + ✅ computeEarnings should take two parameters (3 ms) + ✅ computeEarnings should compute the earnings as a formatted Euro amount (1 ms) + +Test Suites: 1 passed, 1 total +Tests: 2 passed, 2 total +Snapshots: 0 total +Time: 1.018 s +Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex2-mondaysWorth.test.js/i. +No linting errors detected. +No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt b/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt new file mode 100644 index 000000000..d369776f4 --- /dev/null +++ b/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt @@ -0,0 +1,37 @@ +*** Unit Test Error Report *** + +Command failed: npx jest D:/HYF/HYF-Assignments-cohort52/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js --colors --noStackTrace --json + FAIL 1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js + js-wk3-ex3-lemonAllergy + ❌ sanitizeFruitBasket should take two parameters (4 ms) + ❌ sanitizeFruitBasket should not modify the original `fruitBasket` array + ❌ sanitizeFruitBasket should return a new array that does not include the unwanted `lemon` + + ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should take two parameters + + expect(received).toBe(expected) // Object.is equality + + Expected: true + Received: false + + ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should not modify the original `fruitBasket` array + + expect(received).toBe(expected) // Object.is equality + + Expected: true + Received: false + + ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should return a new array that does not include the unwanted `lemon` + + expect(received).toBe(expected) // Object.is equality + + Expected: true + Received: false + +Test Suites: 1 failed, 1 total +Tests: 3 failed, 3 total +Snapshots: 0 total +Time: 1.135 s +Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex3-lemonAllergy.test.js/i. +No linting errors detected. +No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex4-observable.report.txt b/1-JavaScript/Week3/test-reports/ex4-observable.report.txt new file mode 100644 index 000000000..614696d99 --- /dev/null +++ b/1-JavaScript/Week3/test-reports/ex4-observable.report.txt @@ -0,0 +1,15 @@ +*** Unit Test Error Report *** + + PASS 1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.test.js + js-wk3-ex4-observable + ✅ createObservable should exist and be a function (2 ms) + ✅ createObservable should return an object with `subscribe` and a `notify` function properties (1 ms) + ✅ observable should notify all subscribers of any notification (2 ms) + +Test Suites: 1 passed, 1 total +Tests: 3 passed, 3 total +Snapshots: 0 total +Time: 0.952 s, estimated 1 s +Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex4-observable\\ex4-observable.test.js/i. +No linting errors detected. +No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt b/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt new file mode 100644 index 000000000..75a1aa5d1 --- /dev/null +++ b/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt @@ -0,0 +1,17 @@ +*** Unit Test Error Report *** + + PASS .dist/1-JavaScript/Week3/unit-tests/ex5-wallet.test.js + js-wk3-ex5-wallet + ✅ q1: At line 24, which variables are in the scope marked Closure? (3 ms) + ✅ q2: What is in the Call Stack, from top to bottom? (4 ms) + ✅ q3: What tooltip appears when hovering over the third debug button? + ✅ q4: What is displayed in the console? (1 ms) + ✅ q5: The owner of the wallet with insufficient funds is? (1 ms) + +Test Suites: 1 passed, 1 total +Tests: 5 passed, 5 total +Snapshots: 0 total +Time: 0.772 s, estimated 1 s +Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\.dist\\1-JavaScript\\Week3\\unit-tests\\ex5-wallet.test.js/i. +No linting errors detected. +No spelling errors detected. From e5f5ee01dfa6ae37d55c845148f814e368ef9c1d Mon Sep 17 00:00:00 2001 From: aleksandrstarshynov Date: Sun, 9 Mar 2025 16:27:42 +0100 Subject: [PATCH 2/3] Oleksandr Starshynov week3 JS --- .test-summary/TEST_SUMMARY.md | 2 +- .../Week3/assignment/ex3-lemonAllergy.test.js | 21 +++++------ .../ex1-doubleEvenNumbers.test.report.txt | 4 +-- .../ex2-mondaysWorth.test.report.txt | 6 ++-- .../ex3-lemonAllergy.test.report.txt | 36 ++++--------------- .../test-reports/ex4-observable.report.txt | 4 +-- .../Week3/test-reports/ex5-wallet.report.txt | 8 ++--- 7 files changed, 27 insertions(+), 54 deletions(-) diff --git a/.test-summary/TEST_SUMMARY.md b/.test-summary/TEST_SUMMARY.md index f65c79476..94e38b02d 100644 --- a/.test-summary/TEST_SUMMARY.md +++ b/.test-summary/TEST_SUMMARY.md @@ -8,6 +8,6 @@ |----------------------------|--------|--------|--------| | ex1-doubleEvenNumbers.test | 1 | - | ✓ | | ex2-mondaysWorth.test | 2 | - | ✓ | -| ex3-lemonAllergy.test | - | 3 | ✓ | +| ex3-lemonAllergy.test | 3 | - | ✓ | | ex4-observable | 3 | - | ✓ | | ex5-wallet | 5 | - | ✓ | diff --git a/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js b/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js index b01f982af..b3622e593 100644 --- a/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js +++ b/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js @@ -8,30 +8,25 @@ const fruitBasket = [ 'lemon', ]; -const forbidden = 'lemon'; - // ! Function under test -function sanitizeFruitBasket(fruitBasket, forbidden) { - const basket = fruitBasket.filter(fruit => fruit !== forbidden); - return basket; +function sanitizeFruitBasket(basket, fruitAllergy) { + const newBasket = basket.filter((item) => item !== fruitAllergy); + return newBasket; } // ! Unit tests (using Jest) describe('js-wk3-ex3-lemonAllergy', () => { test('sanitizeFruitBasket should take two parameters', () => { - // TODO replace next line with your code - expect(false).toBe(true); + expect(sanitizeFruitBasket.length).toBe(2); }); test('sanitizeFruitBasket should not modify the original `fruitBasket` array', () => { - // Save the original contents of the fruit basket const originalFruitBasketContents = [...fruitBasket]; - // TODO replace next line with your code - expect(false).toBe(true); + expect(originalFruitBasketContents.length).toBe(fruitBasket.length); }); test('sanitizeFruitBasket should return a new array that does not include the unwanted `lemon`', () => { - // TODO replace next line with your code - expect(false).toBe(true); + const allergyArray = sanitizeFruitBasket(fruitBasket, 'lemon'); + expect(allergyArray).not.toContain('lemon'); }); -}); +}); \ No newline at end of file diff --git a/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt index 2d603f4b5..0b3e37a13 100644 --- a/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt +++ b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt @@ -2,12 +2,12 @@ PASS 1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js js-wk3-ex1-doubleEvenNumbers - ✅ doubleEvenNumbers should take the even numbers and double them (3 ms) + ✅ doubleEvenNumbers should take the even numbers and double them (4 ms) Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total -Time: 1.414 s +Time: 1.25 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex1-doubleEvenNumbers.test.js/i. No linting errors detected. No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt index 1ef9d109e..8029a9f5a 100644 --- a/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt +++ b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt @@ -3,17 +3,17 @@ console.log €187.50 - at Object.log (1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js:40:9) + at Object.log (1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js:29:9) PASS 1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js js-wk3-mondaysWorth ✅ computeEarnings should take two parameters (3 ms) - ✅ computeEarnings should compute the earnings as a formatted Euro amount (1 ms) + ✅ computeEarnings should compute the earnings as a formatted Euro amount Test Suites: 1 passed, 1 total Tests: 2 passed, 2 total Snapshots: 0 total -Time: 1.018 s +Time: 0.879 s, estimated 1 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex2-mondaysWorth.test.js/i. No linting errors detected. No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt b/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt index d369776f4..f1d85e54a 100644 --- a/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt +++ b/1-JavaScript/Week3/test-reports/ex3-lemonAllergy.test.report.txt @@ -1,37 +1,15 @@ *** Unit Test Error Report *** -Command failed: npx jest D:/HYF/HYF-Assignments-cohort52/1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js --colors --noStackTrace --json - FAIL 1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js + PASS 1-JavaScript/Week3/assignment/ex3-lemonAllergy.test.js js-wk3-ex3-lemonAllergy - ❌ sanitizeFruitBasket should take two parameters (4 ms) - ❌ sanitizeFruitBasket should not modify the original `fruitBasket` array - ❌ sanitizeFruitBasket should return a new array that does not include the unwanted `lemon` + ✅ sanitizeFruitBasket should take two parameters (3 ms) + ✅ sanitizeFruitBasket should not modify the original `fruitBasket` array + ✅ sanitizeFruitBasket should return a new array that does not include the unwanted `lemon` (1 ms) - ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should take two parameters - - expect(received).toBe(expected) // Object.is equality - - Expected: true - Received: false - - ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should not modify the original `fruitBasket` array - - expect(received).toBe(expected) // Object.is equality - - Expected: true - Received: false - - ● js-wk3-ex3-lemonAllergy › sanitizeFruitBasket should return a new array that does not include the unwanted `lemon` - - expect(received).toBe(expected) // Object.is equality - - Expected: true - Received: false - -Test Suites: 1 failed, 1 total -Tests: 3 failed, 3 total +Test Suites: 1 passed, 1 total +Tests: 3 passed, 3 total Snapshots: 0 total -Time: 1.135 s +Time: 1.307 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex3-lemonAllergy.test.js/i. No linting errors detected. No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex4-observable.report.txt b/1-JavaScript/Week3/test-reports/ex4-observable.report.txt index 614696d99..4ec363075 100644 --- a/1-JavaScript/Week3/test-reports/ex4-observable.report.txt +++ b/1-JavaScript/Week3/test-reports/ex4-observable.report.txt @@ -2,14 +2,14 @@ PASS 1-JavaScript/Week3/assignment/ex4-observable/ex4-observable.test.js js-wk3-ex4-observable - ✅ createObservable should exist and be a function (2 ms) + ✅ createObservable should exist and be a function (7 ms) ✅ createObservable should return an object with `subscribe` and a `notify` function properties (1 ms) ✅ observable should notify all subscribers of any notification (2 ms) Test Suites: 1 passed, 1 total Tests: 3 passed, 3 total Snapshots: 0 total -Time: 0.952 s, estimated 1 s +Time: 0.866 s, estimated 1 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex4-observable\\ex4-observable.test.js/i. No linting errors detected. No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt b/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt index 75a1aa5d1..b417b5ada 100644 --- a/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt +++ b/1-JavaScript/Week3/test-reports/ex5-wallet.report.txt @@ -2,16 +2,16 @@ PASS .dist/1-JavaScript/Week3/unit-tests/ex5-wallet.test.js js-wk3-ex5-wallet - ✅ q1: At line 24, which variables are in the scope marked Closure? (3 ms) - ✅ q2: What is in the Call Stack, from top to bottom? (4 ms) + ✅ q1: At line 24, which variables are in the scope marked Closure? (2 ms) + ✅ q2: What is in the Call Stack, from top to bottom? (1 ms) ✅ q3: What tooltip appears when hovering over the third debug button? ✅ q4: What is displayed in the console? (1 ms) - ✅ q5: The owner of the wallet with insufficient funds is? (1 ms) + ✅ q5: The owner of the wallet with insufficient funds is? Test Suites: 1 passed, 1 total Tests: 5 passed, 5 total Snapshots: 0 total -Time: 0.772 s, estimated 1 s +Time: 0.717 s, estimated 1 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\.dist\\1-JavaScript\\Week3\\unit-tests\\ex5-wallet.test.js/i. No linting errors detected. No spelling errors detected. From 4cff1272676f8ee872a3e7c33747e36a6ae34364 Mon Sep 17 00:00:00 2001 From: aleksandrstarshynov Date: Sun, 9 Mar 2025 16:29:56 +0100 Subject: [PATCH 3/3] added once more tests --- .../test-reports/ex1-doubleEvenNumbers.test.report.txt | 4 ++-- .../Week3/test-reports/ex2-mondaysWorth.test.report.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt index 0b3e37a13..c7aee325b 100644 --- a/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt +++ b/1-JavaScript/Week3/test-reports/ex1-doubleEvenNumbers.test.report.txt @@ -2,12 +2,12 @@ PASS 1-JavaScript/Week3/assignment/ex1-doubleEvenNumbers.test.js js-wk3-ex1-doubleEvenNumbers - ✅ doubleEvenNumbers should take the even numbers and double them (4 ms) + ✅ doubleEvenNumbers should take the even numbers and double them (3 ms) Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total -Time: 1.25 s +Time: 0.945 s, estimated 1 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex1-doubleEvenNumbers.test.js/i. No linting errors detected. No spelling errors detected. diff --git a/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt index 8029a9f5a..a654b9f94 100644 --- a/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt +++ b/1-JavaScript/Week3/test-reports/ex2-mondaysWorth.test.report.txt @@ -3,17 +3,17 @@ console.log €187.50 - at Object.log (1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js:29:9) + at Object.log (1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js:40:9) PASS 1-JavaScript/Week3/assignment/ex2-mondaysWorth.test.js js-wk3-mondaysWorth ✅ computeEarnings should take two parameters (3 ms) - ✅ computeEarnings should compute the earnings as a formatted Euro amount + ✅ computeEarnings should compute the earnings as a formatted Euro amount (1 ms) Test Suites: 1 passed, 1 total Tests: 2 passed, 2 total Snapshots: 0 total -Time: 0.879 s, estimated 1 s +Time: 0.768 s, estimated 1 s Ran all test suites matching /D:\\HYF\\HYF-Assignments-cohort52\\1-JavaScript\\Week3\\assignment\\ex2-mondaysWorth.test.js/i. No linting errors detected. No spelling errors detected.