Skip to content

Commit 5661d47

Browse files
authored
Merge pull request #44 from temyers/revert-20-remove-validation-bypass
Revert "Template validation is now supported by LocalStack, closes #12"
2 parents e06888d + e340586 commit 5661d47

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

‎spec/unit/index.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ describe("LocalstackPlugin", () => {
177177
expect(templateUrl).to.startsWith(`${config.host}`);
178178
});
179179

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+
180189
});
181190

182191
})

‎src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ class LocalstackPlugin {
132132
}
133133

134134
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+
135141
if (AWS.config[service.toLowerCase()]) {
136142
this.debug(`Using custom endpoint for ${service}: ${AWS.config[service.toLowerCase()].endpoint}`);
137143

@@ -142,6 +148,7 @@ class LocalstackPlugin {
142148
}
143149

144150
return this.awsProviderRequest(service, method, params);
151+
145152
}
146153
}
147154

0 commit comments

Comments
 (0)