Skip to content

Commit

Permalink
fix compiler errors and make test pass
Browse files Browse the repository at this point in the history
Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10 👈🏼
- Make "amount" private
- Dollar side-effects?
- Money rounding?
  • Loading branch information
kaiosilveira committed Sep 28, 2022
1 parent bc1534c commit 348cea3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Dollar from '.';

describe('Multi currency money', () => {
it.todo('should sum $5 + 10CHF as being $10 if exchange rate is 2:1');

Expand All @@ -8,4 +10,8 @@ describe('Multi currency money', () => {
expect(five.amount).toEqual(10);
});
});

it.todo('Make "amount" private');
it.todo('Dollar side effects?');
it.todo('Money rounding?');
});
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
console.log('Hello world!');
export default class Dollar {
amount: number;

constructor(amount: number) {
this.amount = amount;
}

times(multiplier: number) {
this.amount *= multiplier;
}
}

0 comments on commit 348cea3

Please sign in to comment.