Remove deployment bucket reference from Service class

This commit is contained in:
Philipp Muens 2017-06-16 08:43:25 +01:00
parent b912ad91bd
commit 9c19d7a773
2 changed files with 0 additions and 37 deletions

View File

@ -7,7 +7,6 @@ const BbPromise = require('bluebird');
const semver = require('semver');
class Service {
constructor(serverless, data) {
this.serverless = serverless;
@ -111,17 +110,6 @@ class Service {
that.service = serverlessFile.service;
}
if (_.isObject(that.provider.deploymentBucket)) {
that.provider.deploymentBucketObject = that.provider.deploymentBucket;
if (that.provider.deploymentBucketObject.name) {
that.provider.deploymentBucket = that.provider.deploymentBucketObject.name;
} else {
delete that.provider.deploymentBucket;
}
} else {
that.provider.deploymentBucketObject = { name: that.provider.deploymentBucket };
}
that.custom = serverlessFile.custom;
that.plugins = serverlessFile.plugins;
that.resources = serverlessFile.resources;
@ -228,15 +216,6 @@ class Service {
getAllEventsInFunction(functionName) {
return this.getFunction(functionName).events;
}
setDeploymentBucketName(name) {
const provider = this.provider;
if (provider.deploymentBucketObject) {
provider.deploymentBucketObject.name = name;
}
provider.deploymentBucket = name;
}
}
module.exports = Service;

View File

@ -923,20 +923,4 @@ describe('Service', () => {
}]);
});
});
describe('#setDeploymentBucketName()', () => {
it('should set the name field of the deploymentBucket object', () => {
const serverless = new Serverless();
const serviceInstance = new Service(serverless);
const newName = 'new-name';
serviceInstance.provider.deploymentBucketObject = {
name: 'old-name',
};
serviceInstance.setDeploymentBucketName(newName);
expect(serviceInstance.provider.deploymentBucketObject.name).to.be.equal(newName);
expect(serviceInstance.provider.deploymentBucket).to.be.equal(newName);
});
});
});