This commit is contained in:
Phil Kunz
2018-09-14 21:02:17 +00:00
parent f078653846
commit df76935a52
9 changed files with 988 additions and 386 deletions

1
test/test.d.ts vendored
View File

@ -1 +0,0 @@
import 'typings-test';

View File

@ -1,16 +0,0 @@
"use strict";
require("typings-test");
const smartchai_1 = require("smartchai");
const tlt = require("../dist/index");
describe('tlt', function () {
let testTlt;
it('should create a valid instance of tlt', function () {
testTlt = new tlt.Tlt('some awesome {{customString}}');
smartchai_1.expect(testTlt).to.be.instanceOf(tlt.Tlt);
});
it('should output a valid string with some data', function () {
let appliedString = testTlt.applyData({ customString: 'horse' });
smartchai_1.expect(appliedString).to.equal('some awesome horse');
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQix5Q0FBa0M7QUFFbEMscUNBQW9DO0FBRXBDLFFBQVEsQ0FBQyxLQUFLLEVBQUU7SUFDZCxJQUFJLE9BQWdCLENBQUE7SUFDcEIsRUFBRSxDQUFDLHVDQUF1QyxFQUFFO1FBQzFDLE9BQU8sR0FBRyxJQUFJLEdBQUcsQ0FBQyxHQUFHLENBQUMsK0JBQStCLENBQUMsQ0FBQTtRQUN0RCxrQkFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQTtJQUMzQyxDQUFDLENBQUMsQ0FBQTtJQUNGLEVBQUUsQ0FBQyw2Q0FBNkMsRUFBRTtRQUNoRCxJQUFJLGFBQWEsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsWUFBWSxFQUFFLE9BQU8sRUFBRSxDQUFDLENBQUE7UUFDaEUsa0JBQU0sQ0FBQyxhQUFhLENBQUMsQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLG9CQUFvQixDQUFDLENBQUE7SUFDdEQsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUMsQ0FBQSJ9

View File

@ -1,16 +1,18 @@
import 'typings-test'
import { expect } from 'smartchai'
import { tap, expect } from '@pushrocks/tapbundle';
import * as tlt from '../dist/index'
import * as tlt from '../dist/index';
describe('tlt', function () {
let testTlt: tlt.Tlt
it('should create a valid instance of tlt', function () {
testTlt = new tlt.Tlt('some awesome {{customString}}')
expect(testTlt).to.be.instanceOf(tlt.Tlt)
})
it('should output a valid string with some data', function () {
let appliedString = testTlt.applyData({ customString: 'horse' })
expect(appliedString).to.equal('some awesome horse')
})
})
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();