Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev committed Sep 6, 2018
1 parent 1c70c9c commit 93b48a3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/test-run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,23 @@ export default class TestRun extends EventEmitter {
}

_resolveCurrentDriverTask (result) {

this.currentDriverTask.resolve(result);
this.driverTaskQueue.shift();

console.log('_resolveCurrentDriverTask: ' + this.test.name + ' length: ' + this.driverTaskQueue.length);

if (this.testDoneCommandQueued)
this._removeAllNonServiceTasks();
}

_rejectCurrentDriverTask (err) {
if (!this.driverTaskQueue[0])
if (!this.driverTaskQueue[0]) {
console.log(this.test.name);
console.log('no task');
}

err.callsite = err.callsite || this.driverTaskQueue[0].callsite;
err.callsite = err.callsite || this.currentDriverTask.callsite;
err.isRejectedDriverTask = true;

this.currentDriverTask.reject(err);
Expand Down Expand Up @@ -684,7 +689,8 @@ export default class TestRun extends EventEmitter {
console.log('disconnect: ' + this.browserConnection.id + ' ' + this.browserConnection.userAgent);
this.disconnected = true;

this._rejectCurrentDriverTask(err);
if (this.currentDriverTask)
this._rejectCurrentDriverTask(err);

this.emit('disconnected', err);

Expand Down

0 comments on commit 93b48a3

Please sign in to comment.