smartscaf/test/test.ts

27 lines
803 B
TypeScript
Raw Normal View History

2017-04-28 22:44:23 +00:00
import { expect, tap } from 'tapbundle'
import * as smartscaf from '../dist/index'
let testScafTemplate: smartscaf.ScafTemplate
tap.test('should create new Smartscaf instance', async () => {
testScafTemplate = new smartscaf.ScafTemplate()
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 () => {
2017-05-03 07:45:22 +00:00
await testScafTemplate.readTemplateFromDir('./test/test_template')
expect(testScafTemplate.templateSmartfileArray.length).to.equal(3)
})
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-04-30 21:58:03 +00:00
tap.start()