Skip to content

Commit 97e3826

Browse files
committed
test when amount equals 0
1 parent 0574cb9 commit 97e3826

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/constructor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ test('accept `amount` of type `string`', t => {
3535
t.is(cashify.convert('12', {from: 'USD', to: 'GBP'}), 9.857142857142856);
3636
});
3737

38+
test('`amount` equals 0', t => {
39+
t.is(cashify.convert(0, {from: 'USD', to: 'GBP'}), 0);
40+
});
41+
3842
test('basic parsing (integer)', t => {
3943
t.is(cashify.convert('$12 USD', {to: 'GBP'}), 9.857142857142856);
4044
});

test/function.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ test('accept `amount` of type `string`', t => {
3131
t.is(convert('12', {from: 'USD', to: 'GBP', base: 'EUR', rates}), 9.857142857142856);
3232
});
3333

34+
test('`amount` equals 0', t => {
35+
t.is(convert(0, {from: 'USD', to: 'GBP', base: 'EUR', rates}), 0);
36+
});
37+
3438
test('basic parsing (integer)', t => {
3539
t.is(convert('$12 USD', {to: 'GBP', base: 'EUR', rates}), 9.857142857142856);
3640
});

0 commit comments

Comments
 (0)