fix(AWS APIGW): Ensure to apply API GW stage settings with no endpoints

Fixes #7036
This commit is contained in:
Mariusz Nowak 2019-12-23 12:15:20 +01:00
parent 4a947b215c
commit dfa0967ecf
No known key found for this signature in database
GPG Key ID: B1FBDA8A182B03F2
2 changed files with 2 additions and 6 deletions

View File

@ -75,10 +75,6 @@ class AwsCompileApigEvents {
const getServiceState = require('../../../../lib/getServiceState').getServiceState;
const state = getServiceState.call(this);
if (!this.serverless.utils.isEventUsed(state.service.functions, 'http')) {
return BbPromise.resolve();
}
const updateStage = require('./lib/hack/updateStage').updateStage;
this.state = state;

View File

@ -142,7 +142,7 @@ describe('AwsCompileApigEvents', () => {
});
});
it('should skip the updateStage step when no http events are found', () => {
it('should not skip the updateStage step when no http events are found', () => {
getServiceStateStub.returns({
service: {
functions: {
@ -154,7 +154,7 @@ describe('AwsCompileApigEvents', () => {
});
return awsCompileApigEvents.hooks['after:deploy:deploy']().then(() => {
expect(updateStageStub.calledOnce).to.equal(false);
expect(updateStageStub.calledOnce).to.equal(true);
});
});
});