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
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