Skip to content

bug(test): resolve test race condition #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions addon/ng2/commands/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ module.exports = TestCommand.extend({

if (commandOptions.watch){
return win.checkWindowsElevation(this.ui)
.then(function() {
.then(_ => {
// perform initial build to avoid race condition
return buildTask.run(buildOptions);
}, _ => { /* handle build error to allow watch mode to start */})
.then(_ => {
return Promise.all([
buildWatchTask.run(buildOptions),
testTask.run(commandOptions)
Expand All @@ -61,10 +65,10 @@ module.exports = TestCommand.extend({
// if not watching ensure karma is doing a single run
commandOptions.singleRun = true;
return win.checkWindowsElevation(this.ui)
.then(function() {
.then(_ => {
return buildTask.run(buildOptions);
})
.then(function(){
.then(_ => {
return testTask.run(commandOptions);
});
}
Expand Down