Skip to content

Commit

Permalink
update hook name
Browse files Browse the repository at this point in the history
  • Loading branch information
horike37 committed Jun 12, 2017
1 parent cae3f1e commit c39cb60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Expand Up @@ -83,13 +83,13 @@ class ServerlessStepFunctions {
this.hooks = {
'invoke:stepf:invoke': () => BbPromise.bind(this)
.then(this.invoke),
'deploy:initialize': () => BbPromise.bind(this)
'package:initialize': () => BbPromise.bind(this)
.then(this.yamlParse),
'deploy:compileFunctions': () => BbPromise.bind(this)
'package:compileFunctions': () => BbPromise.bind(this)
.then(this.compileIamRole)
.then(this.compileStateMachines)
.then(this.compileActivities),
'deploy:compileEvents': () => {
'package:compileEvents': () => {
this.pluginhttpValidated = this.httpValidate();

if (this.pluginhttpValidated.events.length === 0) {
Expand Down
16 changes: 8 additions & 8 deletions lib/index.test.js
Expand Up @@ -57,24 +57,24 @@ describe('#index', () => {
});
});

it('should run deploy:initialize promise chain in order', () => {
it('should run package:initialize promise chain in order', () => {
const yamlParseStub = sinon
.stub(serverlessStepFunctions, 'yamlParse').returns(BbPromise.resolve());
return serverlessStepFunctions.hooks['deploy:initialize']()
return serverlessStepFunctions.hooks['package:initialize']()
.then(() => {
expect(yamlParseStub.calledOnce).to.be.equal(true);
serverlessStepFunctions.yamlParse.restore();
});
});

it('should run deploy:compileFunctions promise chain in order', () => {
it('should run package:compileFunctions promise chain in order', () => {
const compileIamRoleStub = sinon
.stub(serverlessStepFunctions, 'compileIamRole').returns(BbPromise.resolve());
const compileStateMachinesStub = sinon
.stub(serverlessStepFunctions, 'compileStateMachines').returns(BbPromise.resolve());
const compileActivitiesStub = sinon
.stub(serverlessStepFunctions, 'compileActivities').returns(BbPromise.resolve());
return serverlessStepFunctions.hooks['deploy:compileFunctions']()
return serverlessStepFunctions.hooks['package:compileFunctions']()
.then(() => {
expect(compileIamRoleStub.calledOnce).to.be.equal(true);
expect(compileStateMachinesStub.calledAfter(compileIamRoleStub)).to.be.equal(true);
Expand All @@ -85,7 +85,7 @@ describe('#index', () => {
});
});

it('should run deploy:compileEvents promise chain in order when http event is empty',
it('should run package:compileEvents promise chain in order when http event is empty',
() => {
const httpValidateStub = sinon
.stub(serverlessStepFunctions, 'httpValidate').returns({ events: [] });
Expand All @@ -99,7 +99,7 @@ describe('#index', () => {
.stub(serverlessStepFunctions, 'compileHttpIamRole').returns(BbPromise.resolve());
const compileDeploymentStub = sinon
.stub(serverlessStepFunctions, 'compileDeployment').returns(BbPromise.resolve());
return serverlessStepFunctions.hooks['deploy:compileEvents']()
return serverlessStepFunctions.hooks['package:compileEvents']()
.then(() => {
expect(httpValidateStub.calledOnce).to.be.equal(true);
expect(compileRestApiStub.notCalled).to.be.equal(true);
Expand All @@ -116,7 +116,7 @@ describe('#index', () => {
});
});

it('should run deploy:compileEvents promise chain in order',
it('should run package:compileEvents promise chain in order',
() => {
const httpValidateStub = sinon
.stub(serverlessStepFunctions, 'httpValidate').returns({ events: [1, 2, 3] });
Expand All @@ -130,7 +130,7 @@ describe('#index', () => {
.stub(serverlessStepFunctions, 'compileHttpIamRole').returns(BbPromise.resolve());
const compileDeploymentStub = sinon
.stub(serverlessStepFunctions, 'compileDeployment').returns(BbPromise.resolve());
return serverlessStepFunctions.hooks['deploy:compileEvents']()
return serverlessStepFunctions.hooks['package:compileEvents']()
.then(() => {
expect(httpValidateStub.calledOnce).to.be.equal(true);
expect(compileRestApiStub.calledOnce).to.be.equal(true);
Expand Down

0 comments on commit c39cb60

Please sign in to comment.