Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integration with deploy package function #130

Merged
Prev Previous commit
Next Next commit
Adapted unit tests
Frank Schmid committed Jul 26, 2017
commit d494b1ec9f4eda55159500d104d6760f31dce7e5
25 changes: 14 additions & 11 deletions tests/validate.test.js
Original file line number Diff line number Diff line change
@@ -246,7 +246,14 @@ describe('validate', () => {
}],
},
func3: {
handler: 'module2.func3handler',
handler: 'handlers/func3/module2.func3handler',
artifact: 'artifact-func3.zip',
events: [{
nonhttp: 'non-http',
}],
},
func4: {
handler: 'handlers/module2/func3/module2.func3handler',
artifact: 'artifact-func3.zip',
events: [{
nonhttp: 'non-http',
@@ -270,12 +277,10 @@ describe('validate', () => {
.then(() => {
const lib = require('../lib/index');
const expectedLibEntries = {
module1: [
'./module1.js'
],
module2: [
'./module2.js'
]
'module1.js': './module1.js',
'module2.js': './module2.js',
'handlers/func3/module2.js': './handlers/func3/module2.js',
'handlers/module2/func3/module2.js': './handlers/module2/func3/module2.js',
};

expect(lib.entries).to.deep.eq(expectedLibEntries)
@@ -300,9 +305,7 @@ describe('validate', () => {
.then(() => {
const lib = require('../lib/index');
const expectedLibEntries = {
module1: [
'./module1.js'
]
'module1.js': './module1.js'
};

expect(lib.entries).to.deep.eq(expectedLibEntries)
@@ -324,7 +327,7 @@ describe('validate', () => {
module.options.function = testFunction;
expect(() => {
module.validate();
}).to.throw(new RegExp(`^Function "${testFunction}" not found in serverless.yml$`));
}).to.throw(new RegExp(`^Function "${testFunction}" doesn't exist`));
});
});
});