diff --git a/lib/tasks/fastboot-server.js b/lib/tasks/fastboot-server.js index 6f44ce132..26838b868 100644 --- a/lib/tasks/fastboot-server.js +++ b/lib/tasks/fastboot-server.js @@ -23,6 +23,9 @@ module.exports = CoreObject.extend({ debug('run'); const restart = () => this.restart(options); this.addon.on('postBuild', restart); + if (options.build === false) { + restart(options); + } }, start(options) { diff --git a/test/lib-tasks-fastboot-server-test.js b/test/lib-tasks-fastboot-server-test.js index f82d194f5..d6b837d86 100644 --- a/test/lib-tasks-fastboot-server-test.js +++ b/test/lib-tasks-fastboot-server-test.js @@ -60,6 +60,12 @@ describe('fastboot server task', function() { addon.emit('postBuild'); expect(restartStub.called).to.be.ok; }); + + it('calls restart immediately when --build=false', function() { + const restartStub = this.sinon.stub(task, 'restart'); + task.run(new CommandOptions({ build: false })); + expect(restartStub.called).to.be.ok; + }); }); describe('restart', function() {