Skip to content

Commit afc44ad

Browse files
committed
last commit
1 parent 811f3b4 commit afc44ad

File tree

6 files changed

+581
-2
lines changed

6 files changed

+581
-2
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

chapter1/bank-account.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var BankAccount = {
77

88
deposit: function (money) {
99
this.balance = this.balance + money;
10+
return this.balance;
1011
},
1112

1213
widthraw: function (cash) {

chapter1/test/bank-account.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ describe('Bank account', () => {
55
it('should have no money on deposit in the beginning', () => {
66
assert.equal(BankAccount.balance, 0);
77
});
8+
9+
it('should be able to withdraw money', () => {
10+
assert.equal(BankAccount.widthraw(20), -20);
11+
});
12+
13+
it('should be able to deposit money', () => {
14+
assert.equal(BankAccount.deposit(30), 10);
15+
});
816
})

0 commit comments

Comments
 (0)