Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Dollar from '.';

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

describe('multiplication', () => {
it('should multiply $5 by 2 and get $10', () => {
const five = new Dollar(5);
five.times(2);
expect(five.amount).toEqual(10);
});
});
});
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;
}
}