-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathalexa_app_initialization.spec.js
54 lines (44 loc) · 1.38 KB
/
alexa_app_initialization.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*jshint expr: true*/
"use strict";
var fs = require("fs");
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
var expect = chai.expect;
chai.config.includeStack = true;
import * as Alexa from '..'
describe("Alexa", function() {
describe("app", function() {
var testApp = new Alexa.app("testApp");
beforeEach(function() {
testApp = new Alexa.app("testApp");
});
describe("initialization", function() {
describe("defaults", function() {
it("sets persistent session to true", function() {
return expect(testApp.persistentSession).to.eq(true);
});
it("sets exhaustiveUtterances to false", function() {
return expect(testApp.exhaustiveUtterances).to.eq(false);
});
});
it("sets the name of the app", function() {
return expect(testApp.name).to.eq("testApp");
});
it("adds to alexa.apps", function() {
return expect(Alexa.apps["testApp"]).to.eq(testApp);
});
});
});
describe("app without a name", function() {
const CleanAlexaApp = require('../');
var testApp;
beforeEach(function() {
CleanAlexaApp.apps = {};
testApp = new CleanAlexaApp.app();
})
it("doesn't add the app to alexa.apps", function() {
return expect(Object.keys(CleanAlexaApp.apps).length).to.eq(0);
});
});
});