Skip to content

Commit

Permalink
test when amount equals 0
Browse files Browse the repository at this point in the history
  • Loading branch information
xxczaki committed Mar 22, 2020
1 parent 0574cb9 commit 97e3826
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ test('accept `amount` of type `string`', t => {
t.is(cashify.convert('12', {from: 'USD', to: 'GBP'}), 9.857142857142856);
});

test('`amount` equals 0', t => {
t.is(cashify.convert(0, {from: 'USD', to: 'GBP'}), 0);
});

test('basic parsing (integer)', t => {
t.is(cashify.convert('$12 USD', {to: 'GBP'}), 9.857142857142856);
});
Expand Down
4 changes: 4 additions & 0 deletions test/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ test('accept `amount` of type `string`', t => {
t.is(convert('12', {from: 'USD', to: 'GBP', base: 'EUR', rates}), 9.857142857142856);
});

test('`amount` equals 0', t => {
t.is(convert(0, {from: 'USD', to: 'GBP', base: 'EUR', rates}), 0);
});

test('basic parsing (integer)', t => {
t.is(convert('$12 USD', {to: 'GBP', base: 'EUR', rates}), 9.857142857142856);
});
Expand Down

0 comments on commit 97e3826

Please sign in to comment.