Files
30-seconds-of-code/test6/toCurrency/toCurrency.test.js
Angelos Chalaris 5afe81452a Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
2018-06-18 14:18:25 +03:00

13 lines
654 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const expect = require('expect');
const toCurrency = require('./toCurrency.js');
test('Testing toCurrency', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof toCurrency === 'function').toBeTruthy();
expect(toCurrency(123456.789, 'EUR')).toBe('€ 123,456.79');
expect(toCurrency(123456.789, 'USD', 'en-us')).toBe('$123,456.79');
//t.equal(toCurrency(123456.789, 'USD', 'fa'), '۱۲۳٬۴۵۶٫۷۹ ؜$', 'currency: US Dollar | currencyLangFormat: Farsi'); - These break in node
expect(toCurrency(322342436423.2435, 'JPY')).toBe('JP¥ 322,342,436,423');
});