Skip to content

Commit 7aeda5e

Browse files
ex5 added
1 parent 3c3eb40 commit 7aeda5e

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.test-summary/TEST_SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
| ex2-mondaysWorth.test | 2 | - ||
1111
| ex3-lemonAllergy.test | 3 | - ||
1212
| ex4-observable | 3 | - ||
13+
| ex5-wallet | 5 | - ||

1-JavaScript/Week3/assignment/ex5-wallet/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function createWallet(name, cash = 0) {
2323
function transferInto(wallet, amount) {
2424
console.log(
2525
`Transferring ${eurosFormatter.format(amount)} from ${name} to ${
26-
wallet.name
26+
wallet.getName()
2727
}`
2828
);
2929
const withdrawnAmount = withdraw(amount);
@@ -75,7 +75,7 @@ const quiz = {
7575
b: 'cash, name',
7676
c: 'amount, this, wallet'
7777
},
78-
answer: '?',
78+
answer: 'b',
7979
},
8080
q2: {
8181
question: 'What is in the Call Stack, from top to bottom?',
@@ -84,7 +84,7 @@ const quiz = {
8484
b: 'anonymous, transferInto',
8585
c: 'transferInto, anonymous'
8686
},
87-
answer: '?',
87+
answer: 'c',
8888
},
8989
q3: {
9090
question: 'What tooltip appears when hovering over the third debug button?',
@@ -93,7 +93,7 @@ const quiz = {
9393
b: 'Step out of current function',
9494
c: 'Step'
9595
},
96-
answer: '?',
96+
answer: 'a',
9797
},
9898
q4: {
9999
question: 'What is displayed in the console?',
@@ -102,7 +102,7 @@ const quiz = {
102102
b: 'Transferring € 50,00 from Jack to undefined',
103103
c: 'Transferring € 50,00 from Jack to Jane'
104104
},
105-
answer: '?',
105+
answer: 'a',
106106
},
107107
q5: {
108108
question: 'The owner of the wallet with insufficient funds is:',
@@ -111,6 +111,6 @@ const quiz = {
111111
b: 'Joe',
112112
c: 'Jane'
113113
},
114-
answer: '?',
114+
answer: 'c',
115115
},
116116
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*** Unit Test Error Report ***
2+
3+
PASS .dist/1-JavaScript/Week3/unit-tests/ex5-wallet.test.js
4+
js-wk3-ex5-wallet
5+
✅ q1: At line 24, which variables are in the scope marked Closure? (1 ms)
6+
✅ q2: What is in the Call Stack, from top to bottom?
7+
✅ q3: What tooltip appears when hovering over the third debug button?
8+
✅ q4: What is displayed in the console?
9+
✅ q5: The owner of the wallet with insufficient funds is?
10+
11+
Test Suites: 1 passed, 1 total
12+
Tests: 5 passed, 5 total
13+
Snapshots: 0 total
14+
Time: 0.3 s
15+
Ran all test suites matching /\/Users\/dimadoronin\/Documents\/Programming\/HackYourFuture\/Assignments-Cohort54\/.dist\/1-JavaScript\/Week3\/unit-tests\/ex5-wallet.test.js/i.
16+
No linting errors detected.
17+
No spelling errors detected.

0 commit comments

Comments
 (0)