mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Adding spec to test that duplicates uploads
This commit is contained in:
parent
29e13014db
commit
cc0fee96b7
@ -230,7 +230,7 @@ describe('uploadArtifacts', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe.only('#uploadFunctions()', () => {
|
||||
describe('#uploadFunctions()', () => {
|
||||
beforeEach(() => {
|
||||
sinon.stub(fs, 'statSync').returns({ size: 1024 });
|
||||
});
|
||||
@ -253,16 +253,17 @@ describe('uploadArtifacts', () => {
|
||||
});
|
||||
|
||||
it('should upload a single .zip file to the S3 bucket when not packaging individually', () => {
|
||||
awsDeploy.serverless.config.servicePath = 'some/path';
|
||||
awsDeploy.serverless.service.service = 'new-service';
|
||||
awsDeploy.serverless.service.functions = {
|
||||
first: {
|
||||
handler: 'first-handler',
|
||||
package: {
|
||||
artifact: 'artifact.zip',
|
||||
},
|
||||
},
|
||||
second: {
|
||||
handler: 'second-handler',
|
||||
package: {
|
||||
artifact: 'artifact.zip',
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
const uploadZipFileStub = sinon
|
||||
@ -270,8 +271,7 @@ describe('uploadArtifacts', () => {
|
||||
|
||||
return awsDeploy.uploadFunctions().then(() => {
|
||||
expect(uploadZipFileStub.calledOnce).to.be.equal(true);
|
||||
expect(uploadZipFileStub.args[0][0])
|
||||
.to.be.equal(`${awsDeploy.serverless.service.service}.zip`);
|
||||
expect(uploadZipFileStub.args[0][0]).to.be.equal('artifact.zip');
|
||||
awsDeploy.uploadZipFile.restore();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user