Skip to content

Commit

Permalink
Merge 3f38206 into 006071b
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed May 9, 2019
2 parents 006071b + 3f38206 commit b5a4fbe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.42.1 (2019-05-09)
- [Fix bug with `cors: true`](https://github.com/serverless/serverless/pull/6104)

# 1.42.0 (2019-05-09)

- [Update cors.md](https://github.com/serverless/serverless/pull/6027)
Expand Down
2 changes: 0 additions & 2 deletions lib/plugins/aws/package/compile/events/apiGateway/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ class AwsCompileApigEvents {
'after:deploy:deploy': () => {
const updateStage = require('./lib/hack/updateStage').updateStage;

this.validated = this.validate();

if (this.validated.events.length === 0) {
return BbPromise.resolve();
}
Expand Down
17 changes: 4 additions & 13 deletions lib/plugins/aws/package/compile/events/apiGateway/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@ describe('AwsCompileApigEvents', () => {
});

describe('when running the "after:deploy:deploy" promise chain', () => {
afterEach(() => {
awsCompileApigEvents.validate.restore();
});

it('should run the promise chain in order', () => {
const validateStub = sinon.stub(awsCompileApigEvents, 'validate').returns({
awsCompileApigEvents.validated = {
events: [
{
functionName: 'first',
Expand All @@ -131,21 +127,16 @@ describe('AwsCompileApigEvents', () => {
},
},
],
});

};
awsCompileApigEvents.hooks['after:deploy:deploy']().then(() => {
expect(validateStub.calledOnce).to.equal(true);
expect(updateStageStub.calledAfter(validateStub)).to.equal(true);
expect(updateStageStub.calledOnce).to.equal(true);
});
});

it('should skip the updateStage step when no http events are found', () => {
const validateStub = sinon.stub(awsCompileApigEvents, 'validate').returns({
events: [],
});
awsCompileApigEvents.validated = { events: [] };

awsCompileApigEvents.hooks['after:deploy:deploy']().then(() => {
expect(validateStub.calledOnce).to.equal(true);
expect(updateStageStub.calledOnce).to.equal(false);
});
});
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless",
"version": "1.42.0",
"version": "1.42.1",
"engines": {
"node": ">=4.0"
},
Expand Down

0 comments on commit b5a4fbe

Please sign in to comment.