country-data-list
Version:
Data about countries - like their ISO codes and currencies
40 lines (33 loc) • 957 B
JavaScript
import { expect, assert } from 'chai';
import { currencies } from '../src/index.js';
describe('currencies', () => {
describe('all', () => {
it('should be array', () => {
expect(currencies.all).to.be.an('array');
});
});
describe('code', () => {
it('should find USD', () => {
assert.equal(currencies.USD.name, 'United States dollar');
});
});
describe('formatting', () => {
it('decimals should be numbers', () => {
expect(Number.isNaN(currencies.USD.decimals)).to.be.false;
});
});
describe('symbols', () => {
it('should find $', () => {
assert.equal(currencies.USD.symbol, '$');
});
it('should find ¥', () => {
assert.equal(currencies.JPY.symbol, '¥');
});
it('should find R', () => {
assert.equal(currencies.ZAR.symbol, 'R');
});
it('should find AED (has no symbol)', () => {
assert.equal(currencies.AED.symbol, 'د.إ');
});
});
});