Adding spec to test that duplicates uploads

This commit is contained in:
Francisco Guimarães 2018-01-22 22:15:57 -02:00
parent 29e13014db
commit cc0fee96b7

View File

@ -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();
});
});