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-29 00:44:23 +02:00
import * as smartscaf from '../ts/index';
2017-04-29 00:44:23 +02:00
2019-01-27 18:55:38 +01:00
process.env.CI = 'true';
2017-05-25 18:32:53 +02:00
let testScafTemplate: smartscaf.ScafTemplate;
2017-04-29 00:44:23 +02: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 23:58:03 +02:00
tap.test('Smartscaf instance -> should read a template directory', async () => {
await testScafTemplate.readTemplateFromDir();
2018-10-04 16:04:42 +02:00
expect(testScafTemplate.templateSmartfileArray.length).to.equal(6);
});
2017-05-03 09:45:22 +02:00
tap.test('smartfile -> should accept variables', async () => {
await testScafTemplate.supplyVariables({});
console.log(testScafTemplate.missingVariables);
});
2017-04-30 23:58:03 +02:00
2017-05-07 01:23:03 +02:00
tap.test('ask cli', async () => {
await testScafTemplate.askCliForMissingVariables();
});
2017-05-07 01:23:03 +02:00
2017-08-09 16:57:32 +02:00
tap.test('should have valid supplied variables', async () => {
console.log(testScafTemplate.suppliedVariables);
});
2017-08-09 16:57:32 +02:00
2017-05-26 15:32:50 +02:00
tap.test('should output ready rendered template', async () => {
await testScafTemplate.writeToDisk(path.resolve('./test/test_output'));
});
2017-05-26 15:32:50 +02:00
tap.start();