smartmustache/test/test.ts

21 lines
629 B
TypeScript
Raw Permalink 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-15 10:43:01 +00:00
import * as tlt from '../ts/index';
2016-11-20 16:41:26 +00:00
2018-09-15 10:43:01 +00:00
let testMustache: tlt.SmartMustache;
2018-09-14 21:02:17 +00:00
tap.test('should create a valid instance of tlt', async () => {
2019-02-17 16:04:31 +00:00
testMustache = new tlt.SmartMustache(
'some awesome {{customString}} that is {{license}} licensed'
);
2018-09-15 10:43:01 +00:00
expect(testMustache).to.be.instanceOf(tlt.SmartMustache);
2018-09-14 21:02:17 +00:00
});
tap.test('should output a valid string with some data', async () => {
2018-09-15 10:43:01 +00:00
let appliedString = testMustache.applyData({
2018-09-14 21:02:17 +00:00
customString: 'horse',
license: 'MIT'
});
expect(appliedString).to.equal('some awesome horse that is MIT licensed');
});
tap.start();