Skip to content

Commit

Permalink
Merge pull request #4027 from chadhietala/reorder-postbuild-hook
Browse files Browse the repository at this point in the history
Re-order postBuild hook
  • Loading branch information
stefanpenner committed May 7, 2015
2 parents b878608 + 1ef8617 commit 9a9ef86
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/models/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ module.exports = Task.extend({
.then(function() {
return self.builder.build.apply(self.builder, args);
})
.then(this.processBuildResult.bind(this))
.then(this.processAddonBuildSteps.bind(this, 'postBuild'))
.then(this.processBuildResult.bind(this))
.catch(function(error) {

this.processAddonBuildSteps('buildError', error);
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/models/builder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ describe('models/builder.js', function() {
});
});

it('should call postBuild before processBuildResult', function() {
var called = [];

addon.postBuild = function() {
called.push('postBuild');
};

builder.processBuildResult = function() {
called.push('processBuildResult');
};

return builder.build().then(function() {
expect(called).to.deep.equal(['postBuild', 'processBuildResult']);
});
});

it('buildError receives the error object from the errored step', function() {
var thrownBuildError = new Error('buildError');
var receivedBuildError;
Expand Down

0 comments on commit 9a9ef86

Please sign in to comment.