mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Add tests.
This commit is contained in:
parent
d85a67cf37
commit
d4cb2b6684
@ -135,6 +135,23 @@ describe('checkForChanges', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should translate error if rejected due to missing bucket', () => {
|
||||
listObjectsV2Stub
|
||||
.rejects(new serverless.classes.Error('The specified bucket does not exist'));
|
||||
|
||||
return expect(awsDeploy.getMostRecentObjects()).to.be.rejectedWith([
|
||||
`The serverless deployment bucket "${awsDeploy.bucketName}" does not exist.`,
|
||||
'Create it manually if you want to reuse the CloudFormation stack "my-service-dev",',
|
||||
'or delete the stack then run "sls deploy".',
|
||||
].join(' '));
|
||||
});
|
||||
|
||||
it('should throw original error if rejected not due to missing bucket', () => {
|
||||
listObjectsV2Stub
|
||||
.rejects(new serverless.classes.Error('Other reason'));
|
||||
return expect(awsDeploy.getMostRecentObjects()).to.be.rejectedWith('Other reason');
|
||||
});
|
||||
|
||||
it('should resolve if result array is empty', () => {
|
||||
const serviceObjects = {
|
||||
Contents: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user