alexa-message-builder
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -41,3 +41,3 @@ 'use strict' | ||
if (typeof this.template.response.outputSpeech === 'object') | ||
if (typeof this.template.response.outputSpeech === 'object' && !isReprompt) | ||
throw new Error('You can call addText or addSSML only once') | ||
@@ -44,0 +44,0 @@ |
{ | ||
"name": "alexa-message-builder", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Simple builder for Alexa replies.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -167,2 +167,23 @@ /* global describe, it, expect */ | ||
}) | ||
it('before reprompt', () => { | ||
const message = new AlexaMessageBuilder().addOutputSpeech('SSML', 'some text', false).addRepromptSSML('some reprompt text') | ||
expect(message.get()).toEqual({ | ||
version: '1.0', | ||
response: { | ||
shouldEndSession: true, | ||
outputSpeech : { | ||
type: 'SSML', | ||
ssml: 'some text' | ||
}, | ||
reprompt: { | ||
outputSpeech : { | ||
type: 'SSML', | ||
ssml: 'some reprompt text' | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
@@ -169,0 +190,0 @@ |
25037
343