Last active
September 29, 2017 22:01
-
-
Save jkelvie/352f04663b96105bf49915e8790f71ca to your computer and use it in GitHub Desktop.
A Simple Test Using Virtual Alexa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("Launches and plays", (done) => { | |
// Launch the skill | |
alexa.launch().then((payload) => { | |
// Test the correct text response comes back | |
expect(payload.response.outputSpeech.ssml).toContain("We show you images we got from Giphy"); | |
// Once it launches, say Yes | |
return alexa.utter("yes"); | |
}).then((payload) => { | |
expect(payload.response.outputSpeech.ssml).toContain("Take a look at this image"); | |
// Cancel after the second interaction | |
return alexa.utter("cancel"); | |
}).then((payload) => { | |
// Make sure the skill gracefully exists and ends the session | |
expect(payload.response.outputSpeech.ssml).toContain("Goodbye"); | |
expect(payload.response.shouldEndSession).toBe(true); | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment