Fixed uploadArtifacts tests

This commit is contained in:
Alex Casalboni 2017-09-22 17:48:49 -04:00
parent 7f0e30b631
commit fc3f0b879a

View File

@ -19,7 +19,7 @@ describe('uploadArtifacts', () => {
beforeEach(() => {
serverless = new Serverless();
serverless.config.servicePath = 'foo';
serverless.setProvider('aws', new AwsProvider(serverless));
serverless.setProvider('aws', new AwsProvider(serverless, {}));
const options = {
stage: 'dev',
region: 'us-east-1',
@ -77,7 +77,18 @@ describe('uploadArtifacts', () => {
});
describe('#enableBucketAcceleration()', () => {
it('should enable the S3 bucket transfer acceleration', () => {
it('should NOT enable the S3 bucket transfer acceleration by default', () => {
const putBucketAccelerateConfigurationStub = sinon
.stub(awsDeploy.provider, 'request').resolves();
return awsDeploy.enableBucketAcceleration().then(() => {
expect(putBucketAccelerateConfigurationStub.called).to.equal(false);
awsDeploy.provider.request.restore();
});
});
it('should enable the S3 bucket transfer acceleration, when enabled', () => {
awsDeploy.provider.options['aws-s3-accelerate'] = true;
const putBucketAccelerateConfigurationStub = sinon
.stub(awsDeploy.provider, 'request').resolves();