update to support dots as usual

This commit is contained in:
2017-08-09 16:30:30 +02:00
parent 8b6a15388e
commit 2a45270902
5 changed files with 57 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import { expect, tap } from 'tapbundle'
import * as smartinteract from '../dist/index'
import * as smartinteract from '../ts/index'
let testInteract: smartinteract.SmartInteract
@@ -22,12 +22,19 @@ tap.test('should add question to SmartInteract instance', async () => {
message: 'what is your second favourite color? Answer is red',
default: 'red'
}])
testInteract.addQuestions([ {
name: 'some.dotted.name',
type: 'input',
message: 'what is your second favourite color? Answer is red',
default: 'aValidAnswer'
}])
})
tap.test('should use default value when not in CI', async () => {
let answerBucket = await testInteract.runQueue()
expect(answerBucket.getAnswerFor('testQuestion1')).to.equal('blue')
expect(answerBucket.getAnswerFor('testQuestion2')).to.equal('red')
expect(answerBucket.getAnswerFor('some.dotted.name')).to.equal('aValidAnswer')
})
tap.start()