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 c9c514a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 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 Down
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 c9c514a

Please sign in to comment.