-
Notifications
You must be signed in to change notification settings - Fork 126
/
index.test.js
48 lines (41 loc) · 1.5 KB
/
index.test.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
'use strict';
const GoogleIndex = require('./index');
const GoogleProvider = require('./provider/googleProvider');
const GooglePackage = require('./package/googlePackage');
const GoogleDeploy = require('./deploy/googleDeploy');
const GoogleRemove = require('./remove/googleRemove');
const GoogleInvoke = require('./invoke/googleInvoke');
const GoogleLogs = require('./logs/googleLogs');
const GoogleInfo = require('./info/googleInfo');
const Serverless = require('./test/serverless');
describe('GoogleIndex', () => {
let serverless;
let options;
let googleIndex;
beforeEach(() => {
serverless = new Serverless();
options = {
stage: 'my-stage',
region: 'my-region',
};
googleIndex = new GoogleIndex(serverless, options);
});
describe('#constructor()', () => {
it('should set the serverless instance', () => {
expect(googleIndex.serverless).toEqual(serverless);
});
it('should set options if provided', () => {
expect(googleIndex.options).toEqual(options);
});
it('should add all the plugins to the Serverless PluginManager', () => {
const addedPlugins = serverless.plugins;
expect(addedPlugins).toContain(GoogleProvider);
expect(addedPlugins).toContain(GooglePackage);
expect(addedPlugins).toContain(GoogleDeploy);
expect(addedPlugins).toContain(GoogleRemove);
expect(addedPlugins).toContain(GoogleInvoke);
expect(addedPlugins).toContain(GoogleLogs);
expect(addedPlugins).toContain(GoogleInfo);
});
});
});