smartscaf/test/test.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

import { expect, tap } from '@pushrocks/tapbundle';
import * as path from 'path';
2017-04-28 22:44:23 +00:00
import * as smartscaf from '../ts/index';
2017-04-28 22:44:23 +00:00
process.env.CI = 'true'
2017-05-25 16:32:53 +00:00
let testScafTemplate: smartscaf.ScafTemplate;
2017-04-28 22:44:23 +00:00
tap.test('should create new Smartscaf instance', async () => {
testScafTemplate = new smartscaf.ScafTemplate('./test/test_template');
expect(testScafTemplate).to.be.instanceof(smartscaf.ScafTemplate);
});
2017-04-30 21:58:03 +00:00
tap.test('Smartscaf instance -> should read a template directory', async () => {
await testScafTemplate.readTemplateFromDir();
2018-10-04 14:04:42 +00:00
expect(testScafTemplate.templateSmartfileArray.length).to.equal(6);
});
2017-05-03 07:45:22 +00:00
tap.test('smartfile -> should accept variables', async () => {
await testScafTemplate.supplyVariables({});
console.log(testScafTemplate.missingVariables);
});
2017-04-30 21:58:03 +00:00
2017-05-06 23:23:03 +00:00
tap.test('ask cli', async () => {
await testScafTemplate.askCliForMissingVariables();
});
2017-05-06 23:23:03 +00:00
2017-08-09 14:57:32 +00:00
tap.test('should have valid supplied variables', async () => {
console.log(testScafTemplate.suppliedVariables);
});
2017-08-09 14:57:32 +00:00
2017-05-26 13:32:50 +00:00
tap.test('should output ready rendered template', async () => {
await testScafTemplate.writeToDisk(path.resolve('./test/test_output'));
});
2017-05-26 13:32:50 +00:00
tap.start();