UNPKG

fill-tpl

Version:
10 lines (7 loc) 286 B
const fill = require('.'); test('Fill right', () => { expect(fill('something went ${GOOD}').with({ GOOD: 'wrong' })).toBe('something went wrong'); }); test('Fill wrong', () => { expect(() => fill('something went ${BAD}').with({ GOOD: 'wrong' })).toThrowError(ReferenceError); });