mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
be consistent in naming
This commit is contained in:
parent
6634145c94
commit
012e0f4aa8
@ -23,8 +23,8 @@ class AwsDeployFunction {
|
||||
.then(this.logStatus)
|
||||
.then(this.checkIfFunctionExists),
|
||||
|
||||
'deploy:function:zipFunction': () => BbPromise.bind(this)
|
||||
.then(this.zipFunction),
|
||||
'deploy:function:packageFunction': () => BbPromise.bind(this)
|
||||
.then(this.packageFunction),
|
||||
|
||||
'deploy:function:deploy': () => BbPromise.bind(this)
|
||||
.then(this.deployFunction)
|
||||
@ -34,7 +34,7 @@ class AwsDeployFunction {
|
||||
|
||||
logStatus() {
|
||||
this.serverless.cli.log(`Deploying function: ${this.options.function}...`);
|
||||
BbPromise.resolve();
|
||||
return BbPromise.resolve();
|
||||
}
|
||||
|
||||
checkIfFunctionExists() {
|
||||
@ -65,7 +65,8 @@ class AwsDeployFunction {
|
||||
return BbPromise.resolve();
|
||||
}
|
||||
|
||||
zipFunction() {
|
||||
packageFunction() {
|
||||
this.serverless.cli.log(`Packaging function: ${this.options.function}...`);
|
||||
return this.pkg.packageFunction(this.options.function);
|
||||
}
|
||||
|
||||
|
||||
@ -76,13 +76,13 @@ describe('AwsDeployFunction', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should run "deploy:function:zipFunction" promise chain in order', () => {
|
||||
const zipFunctionStub = sinon
|
||||
.stub(awsDeployFunction, 'zipFunction').returns(BbPromise.resolve());
|
||||
it('should run "deploy:function:packageFunction" promise chain in order', () => {
|
||||
const packageFunctionStub = sinon
|
||||
.stub(awsDeployFunction, 'packageFunction').returns(BbPromise.resolve());
|
||||
|
||||
return awsDeployFunction.hooks['deploy:function:zipFunction']().then(() => {
|
||||
expect(zipFunctionStub.calledOnce).to.equal(true);
|
||||
awsDeployFunction.zipFunction.restore();
|
||||
return awsDeployFunction.hooks['deploy:function:packageFunction']().then(() => {
|
||||
expect(packageFunctionStub.calledOnce).to.equal(true);
|
||||
awsDeployFunction.packageFunction.restore();
|
||||
});
|
||||
});
|
||||
|
||||
@ -136,7 +136,7 @@ describe('AwsDeployFunction', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#zipFunction()', () => {
|
||||
describe('#packageFunction()', () => {
|
||||
it('should zip the function', () => {
|
||||
const pkg = new Package();
|
||||
|
||||
@ -145,7 +145,7 @@ describe('AwsDeployFunction', () => {
|
||||
const packageFunctionStub = sinon
|
||||
.stub(pkg, 'packageFunction').returns(BbPromise.resolve());
|
||||
|
||||
return awsDeployFunction.zipFunction().then(() => {
|
||||
return awsDeployFunction.packageFunction().then(() => {
|
||||
expect(packageFunctionStub.calledOnce).to.be.equal(true);
|
||||
expect(packageFunctionStub.args[0][0]).to.be.equal(awsDeployFunction.options.function);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user