forked from alexa-js/alexa-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*jshint expr: true*/ | ||
"use strict"; | ||
var chai = require("chai"); | ||
var chaiAsPromised = require("chai-as-promised"); | ||
var mockHelper = require("./helpers/mock_helper"); | ||
chai.use(chaiAsPromised); | ||
var expect = chai.expect; | ||
chai.config.includeStack = true; | ||
|
||
describe("Alexa", function() { | ||
var Alexa = require("../index"); | ||
describe("app", function() { | ||
describe("#utterances", function() { | ||
var app = new Alexa.app("myapp"); | ||
app.intent("testIntentTwo", { | ||
"slots": { | ||
"NAME": "LITERAL", | ||
"AGE": "NUMBER" | ||
}, | ||
"utterances": ["my {name is|name's} {names|NAME} and {I am|I'm} {1-2|AGE}{ years old|}"] | ||
}); | ||
app.intent("testIntent", { | ||
"slots": { | ||
"AirportCode": "FAACODES", | ||
}, | ||
"utterances": ["{|flight|airport} {|delays} {|for} {-|AirportCode}"] | ||
}); | ||
it("generates expected list of sample utterances", function() { | ||
var subject = app.utterances(); | ||
var expected = "testIntentTwo" + "\t" + "my name is {names|NAME} and I am {one|AGE} years old" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name's {names|NAME} and I am {two|AGE} years old" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name is {names|NAME} and I'm {one|AGE} years old" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name's {names|NAME} and I'm {two|AGE} years old" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name is {names|NAME} and I am {one|AGE}" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name's {names|NAME} and I am {two|AGE}" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name is {names|NAME} and I'm {one|AGE}" + "\n"; | ||
expected += "testIntentTwo" + "\t" + "my name's {names|NAME} and I'm {two|AGE}" + "\n"; | ||
expected += "testIntent" + "\t" + "{AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "flight {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "airport {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "delays {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "flight delays {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "airport delays {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "for {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "flight for {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "airport for {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "delays for {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "flight delays for {AirportCode}" + "\n"; | ||
expected += "testIntent" + "\t" + "airport delays for {AirportCode}" + "\n"; | ||
expect(subject).to.eq(expected); | ||
}); | ||
}); | ||
}); | ||
}); |