Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Wolfgang committed Nov 6, 2020
1 parent 80511c8 commit 0ab059e
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lib/deploy/events/apiGateway/methods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,24 +354,23 @@ describe('#methods()', () => {
.to.have.property('MethodResponses');
});

it('should set Access-Control-Allow-Origin header when cors is true',
() => {
expect(serverlessStepFunctions.getMethodResponses({
cors: {
origins: ['*', 'http://example.com'],
},
}).Properties.MethodResponses[0]
.ResponseParameters['method.response.header.Access-Control-Allow-Origin'])
.to.be.true;
it('should set Access-Control-Allow-Origin header when cors is true', () => {
expect(serverlessStepFunctions.getMethodResponses({
cors: {
origins: ['*', 'http://example.com'],
},
}).Properties.MethodResponses[0]
.ResponseParameters['method.response.header.Access-Control-Allow-Origin'])
.to.equal(true);

expect(serverlessStepFunctions.getMethodResponses({
cors: {
origin: '*',
},
}).Properties.MethodResponses[0]
.ResponseParameters['method.response.header.Access-Control-Allow-Origin'])
.to.be.true;
});
expect(serverlessStepFunctions.getMethodResponses({
cors: {
origin: '*',
},
}).Properties.MethodResponses[0]
.ResponseParameters['method.response.header.Access-Control-Allow-Origin'])
.to.equal(true);
});

it('should set custom custom headers when one is given',
() => {
Expand Down

0 comments on commit 0ab059e

Please sign in to comment.