diff --git a/test/constructor.ts b/test/constructor.ts index 71287d3..70fc146 100644 --- a/test/constructor.ts +++ b/test/constructor.ts @@ -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); }); diff --git a/test/function.ts b/test/function.ts index 84c33d7..3c23944 100644 --- a/test/function.ts +++ b/test/function.ts @@ -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); });