Skip to content

Commit 654c507

Browse files
committed
test(AWS Websocket): Prepare tests refactor plan
1 parent e7c58f3 commit 654c507

File tree

1 file changed

+73
-0
lines changed
  • test/unit/lib/plugins/aws/package/compile/events/websockets

1 file changed

+73
-0
lines changed

test/unit/lib/plugins/aws/package/compile/events/websockets/index.test.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const sinon = require('sinon');
55
const AwsProvider = require('../../../../../../../../../lib/plugins/aws/provider');
66
const AwsCompileWebsocketsEvents = require('../../../../../../../../../lib/plugins/aws/package/compile/events/websockets/index');
77
const Serverless = require('../../../../../../../../../lib/Serverless');
8+
const runServerless = require('../../../../../../../../utils/run-serverless');
89

910
describe('AwsCompileWebsocketsEvents', () => {
1011
let awsCompileWebsocketsEvents;
@@ -111,3 +112,75 @@ describe('AwsCompileWebsocketsEvents', () => {
111112
});
112113
});
113114
});
115+
116+
describe('test/unit/lib/plugins/aws/package/compile/events/websockets/index.test.js', () => {
117+
describe.skip('TODO: regular configuration', () => {
118+
before(async () => {
119+
await runServerless({
120+
fixture: 'function',
121+
command: 'package',
122+
123+
configExt: {
124+
functions: {
125+
basic: {
126+
events: [
127+
{
128+
websocket: '$connect',
129+
},
130+
],
131+
},
132+
},
133+
},
134+
});
135+
});
136+
137+
it('should create a websocket api resource', () => {
138+
// Replaces
139+
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L37-L52
140+
});
141+
142+
it('should configure expected IAM', () => {
143+
// Replaces
144+
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L66-L91
145+
});
146+
});
147+
148+
describe.skip('TODO: external websocket API', () => {
149+
before(async () => {
150+
await runServerless({
151+
fixture: 'function',
152+
command: 'package',
153+
154+
configExt: {
155+
provider: {
156+
apiGateway: {
157+
websocketApiId: '5ezys3sght',
158+
},
159+
iam: {
160+
role: 'arn:aws:iam::123456789012:role/fromProvider',
161+
},
162+
},
163+
functions: {
164+
basic: {
165+
events: [
166+
{
167+
websocket: '$connect',
168+
},
169+
],
170+
},
171+
},
172+
},
173+
});
174+
});
175+
176+
it('should not create a websocket api resource', () => {
177+
// Replaces
178+
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L54-L64
179+
});
180+
181+
it('should not configure IAM policies with custom roles', () => {
182+
// Replaces
183+
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L93-L103
184+
});
185+
});
186+
});

0 commit comments

Comments
 (0)