Skip to content

Commit

Permalink
Correctly instantiate Watcher instance when running ember test --serve
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Dec 9, 2022
1 parent dcb36aa commit add7fa9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 9 additions & 7 deletions lib/commands/test.js
Expand Up @@ -182,13 +182,15 @@ module.exports = Command.extend({
session = this.runTask('TestServer', testOptions);
} else {
let builder = new this.Builder(testOptions);
testOptions.watcher = new this.Watcher(
Object.assign(this._env(), {
builder,
verbose: false,
options: commandOptions,
})
);
testOptions.watcher = (
await this.Watcher.build(
Object.assign(this._env(), {
builder,
verbose: false,
options: commandOptions,
})
)
).watcher;
session = this.runTask('TestServer', testOptions).finally(() => builder.cleanup());
}
} else if (hasBuild) {
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/commands/test-test.js
Expand Up @@ -188,7 +188,11 @@ describe('test command', function () {
buildCleanupWasCalled = true;
},
});
options.Watcher = CoreObject.extend();
options.Watcher = class Watcher extends CoreObject {
static build() {
return { watcher: new this(...arguments) };
}
};

buildCommand();
});
Expand Down

0 comments on commit add7fa9

Please sign in to comment.