Skip to content

Commit

Permalink
Merge pull request #388 from JackCA/fix-serve-hook-validate-order
Browse files Browse the repository at this point in the history
run beforeBuild hook before validating on serve
  • Loading branch information
alexblom authored Oct 12, 2017
2 parents 90fff1f + c5bf399 commit 81a7115
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ module.exports = Command.extend({
let ui = this.ui;

return editXml.addNavigation(project, reloadUrl)
.then(() => hook.run('beforeBuild', opts))
.then(() => cordovaTarget.validateServe())
.then(() => framework.validateServe(opts))
.then(() => hook.run('beforeBuild', opts))
.then(() => setupLivereload.run(reloadUrl))
.then(function() {
if (opts.skipCordovaBuild !== true) {
Expand Down
4 changes: 2 additions & 2 deletions node-tests/unit/commands/serve-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ describe('Serve Command', function() {
it('runs tasks in the correct order', function() {
return serveCmd.run({}).then(function() {
expect(tasks).to.deep.equal([
'hook beforeBuild',
'validate-allow-navigation',
'validate-platform',
'validate-plugin',
'framework-validate-serve',
'hook beforeBuild',
'create-livereload-shell',
'cordova-build',
'hook afterBuild',
Expand Down Expand Up @@ -146,11 +146,11 @@ describe('Serve Command', function() {
skipCordovaBuild: true
}).then(function() {
expect(tasks).to.deep.equal([
'hook beforeBuild',
'validate-allow-navigation',
'validate-platform',
'validate-plugin',
'framework-validate-serve',
'hook beforeBuild',
'create-livereload-shell',
'hook afterBuild'
]);
Expand Down

0 comments on commit 81a7115

Please sign in to comment.