Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test case to increase coverage.
  • Loading branch information
exoego committed Jan 11, 2019
1 parent 6e0d7a8 commit 855a520
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/classes/Variables.test.js
Expand Up @@ -208,6 +208,25 @@ describe('Variables', () => {
});
});
describe('stage name validation', () => {
it('should not throw an error if http event is absent and stage contains hyphen', () => {
const serverlessYml = {
service: 'new-service',
provider: {
name: 'aws',
stage: 'my-stage',
},
functions: {
first: {
events: [
],
},
},
};
serverless.service = new serverless.classes.Service(serverless, serverlessYml);

return serverless.variables.populateService().should.be.fullfilled;
});

it('should throw an error if http event is present and stage contains hyphen', () => {
const serverlessYml = {
service: 'new-service',
Expand Down

0 comments on commit 855a520

Please sign in to comment.