Skip to content

Instantly share code, notes, and snippets.

@jkelvie
Last active September 29, 2017 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkelvie/352f04663b96105bf49915e8790f71ca to your computer and use it in GitHub Desktop.
Save jkelvie/352f04663b96105bf49915e8790f71ca to your computer and use it in GitHub Desktop.
A Simple Test Using Virtual Alexa
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