smartmustache/test/test.ts

19 lines
573 B
TypeScript
Raw Normal View History

2018-09-14 21:02:17 +00:00
import { tap, expect } from '@pushrocks/tapbundle';
2016-11-20 16:41:26 +00:00
2018-09-14 21:02:17 +00:00
import * as tlt from '../dist/index';
2016-11-20 16:41:26 +00:00
2018-09-14 21:02:17 +00:00
let testTlt: tlt.Tlt;
tap.test('should create a valid instance of tlt', async () => {
testTlt = new tlt.Tlt('some awesome {{customString}} that is {{license}} licensed');
expect(testTlt).to.be.instanceOf(tlt.Tlt);
});
tap.test('should output a valid string with some data', async () => {
let appliedString = testTlt.applyData({
customString: 'horse',
license: 'MIT'
});
expect(appliedString).to.equal('some awesome horse that is MIT licensed');
});
tap.start();