File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,15 @@ describe("LocalstackPlugin", () => {
177
177
expect ( templateUrl ) . to . startsWith ( `${ config . host } ` ) ;
178
178
} ) ;
179
179
180
+ it ( 'should not send validateTemplate calls to localstack' , ( ) => {
181
+ let pathToTemplate = 'https://s3.amazonaws.com/path/to/template' ;
182
+ let request = sinon . stub ( awsProvider , 'request' ) ;
183
+ instance = new LocalstackPlugin ( serverless , { } )
184
+ awsProvider . request ( 'S3' , 'validateTemplate' , { } ) ;
185
+
186
+ expect ( request . called ) . to . be . false ;
187
+ } ) ;
188
+
180
189
} ) ;
181
190
182
191
} )
Original file line number Diff line number Diff line change @@ -132,6 +132,12 @@ class LocalstackPlugin {
132
132
}
133
133
134
134
interceptRequest ( service , method , params ) {
135
+ // // Template validation is not supported in LocalStack
136
+ if ( method == "validateTemplate" ) {
137
+ this . log ( 'Skipping template validation: Unsupported in Localstack' ) ;
138
+ return Promise . resolve ( "" ) ;
139
+ }
140
+
135
141
if ( AWS . config [ service . toLowerCase ( ) ] ) {
136
142
this . debug ( `Using custom endpoint for ${ service } : ${ AWS . config [ service . toLowerCase ( ) ] . endpoint } ` ) ;
137
143
@@ -142,6 +148,7 @@ class LocalstackPlugin {
142
148
}
143
149
144
150
return this . awsProviderRequest ( service , method , params ) ;
151
+
145
152
}
146
153
}
147
154
You can’t perform that action at this time.
0 commit comments