Skip to content

Instantly share code, notes, and snippets.

@jkelvie
Created October 30, 2017 17:13
Show Gist options
  • Save jkelvie/c2e90490ef10ca6500ab22b7ff069e2f to your computer and use it in GitHub Desktop.
Save jkelvie/c2e90490ef10ca6500ab22b7ff069e2f to your computer and use it in GitHub Desktop.
it("Launches successfully", async function() {
const bvd = require("virtual-alexa");
const alexa = bvd.VirtualAlexa.Builder()
.handler("index.handler") // Lambda function file and name
.intentSchemaFile("./speechAssets/IntentSchema.json")
.sampleUtterancesFile("./speechAssets/SampleUtterances.txt")
.create();
let reply = await alexa.launch();
assert.include(reply.response.outputSpeech.ssml, "Welcome to guess the price");
// Skill asks for number of players
reply = await alexa.utter("2");
assert.include(reply.response.outputSpeech.ssml, "what is your name");
assert.include(reply.response.outputSpeech.ssml, "contestant one");
// Skill asks for name of player one
reply = await alexa.utter("john");
assert.include(reply.response.outputSpeech.ssml, "what is your name");
assert.include(reply.response.outputSpeech.ssml, "Contestant 2");
// Skill asks for name of player two
reply = await alexa.utter("juan");
assert.include(reply.response.outputSpeech.ssml, "let's start the game");
assert.include(reply.response.outputSpeech.ssml, "Guess the price");
// Skill asks the first player to guess the price of an item
reply = await alexa.utter("200 dollars");
assert.include(reply.response.outputSpeech.ssml, "the actual price was");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment