UNPKG

@t7/utils

Version:

Utility methods for T7 components.

27 lines (21 loc) 630 B
// Dependencies. import { formatMoneyUS } from './' // Describe test. describe('formatMoneyUS', () => { // =========================== // Test for "existing" values. // =========================== it('handles "existing" values', () => { expect(formatMoneyUS(1000).replace(/\s+/g, '')) .toBe('$1,000.00') }) // ======================================= // Test for `null` and `undefined` values. // ======================================= it('handles `null` and `undefined` values', () => { expect(formatMoneyUS(null)) .toBe('') expect(formatMoneyUS(undefined)) .toBe('') }) })