Skip to content

Commit

Permalink
add test case for new mappings object export
Browse files Browse the repository at this point in the history
  • Loading branch information
panoply committed Aug 23, 2021
1 parent 798ebf3 commit 086260c
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
import test from "ava";
import { getCurrencySymbol } from "../package/index.es";
import test from 'ava';
import { getCurrencySymbol } from '../package/index';

test("Currency code", (t) => {
t.is(getCurrencySymbol("sEK"), "kr");
t.is(getCurrencySymbol("eur"), "€");
t.is(getCurrencySymbol("USD"), "$");
t.is(getCurrencySymbol("AuD"), "$");
test('Currency code symbols', (t) => {

t.is(getCurrencySymbol('sEK'), 'kr');
t.is(getCurrencySymbol('eur'), '€');
t.is(getCurrencySymbol('USD'), '$');
t.is(getCurrencySymbol('AuD'), '$');

t.pass();

});

test('Currency code in uppercase to symbol', (t) => {

t.is(getCurrencySymbol('SEK'), 'kr');
t.is(getCurrencySymbol('EUR'), '€');
t.is(getCurrencySymbol('USD'), '$');
t.is(getCurrencySymbol('AUD'), '$');

t.pass();

});

test("Currency code in uppercase", (t) => {
t.is(getCurrencySymbol("SEK"), "kr");
t.is(getCurrencySymbol("EUR"), "€");
t.is(getCurrencySymbol("USD"), "$");
t.is(getCurrencySymbol("AUD"), "$");
test('Currency code in lowercase to symbol', (t) => {

t.is(getCurrencySymbol('sek'), 'kr');
t.is(getCurrencySymbol('eur'), '€');
t.is(getCurrencySymbol('usd'), '$');
t.is(getCurrencySymbol('aud'), '$');

t.pass();

});

test("Currency code in lowercase", (t) => {
t.is(getCurrencySymbol("sek"), "kr");
t.is(getCurrencySymbol("eur"), "€");
t.is(getCurrencySymbol("usd"), "$");
t.is(getCurrencySymbol("aud"), "$");
test('Exposed currency symbols export mapping object', (t) => {

t.is(getCurrencySymbol('sek'), 'kr');
t.is(getCurrencySymbol('eur'), '€');
t.is(getCurrencySymbol('usd'), '$');
t.is(getCurrencySymbol('aud'), '$');

t.pass();

});

0 comments on commit 086260c

Please # to comment.