@@ -5,6 +5,7 @@ const sinon = require('sinon');
5
5
const AwsProvider = require ( '../../../../../../../../../lib/plugins/aws/provider' ) ;
6
6
const AwsCompileWebsocketsEvents = require ( '../../../../../../../../../lib/plugins/aws/package/compile/events/websockets/index' ) ;
7
7
const Serverless = require ( '../../../../../../../../../lib/Serverless' ) ;
8
+ const runServerless = require ( '../../../../../../../../utils/run-serverless' ) ;
8
9
9
10
describe ( 'AwsCompileWebsocketsEvents' , ( ) => {
10
11
let awsCompileWebsocketsEvents ;
@@ -111,3 +112,75 @@ describe('AwsCompileWebsocketsEvents', () => {
111
112
} ) ;
112
113
} ) ;
113
114
} ) ;
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