Skip to content

Commit

Permalink
update suite.tests with last retried test
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Feb 12, 2020
1 parent 2ff1cb2 commit 98107a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ function Runner(suite, delay) {
this.total = suite.total();
this.failures = 0;
this.on(constants.EVENT_TEST_END, function(test) {
if (test._retriedTest) {
var idx = suite.tests && suite.tests.indexOf(test._retriedTest);
if (idx > -1) suite.tests[idx] = test;
}
self.checkGlobals(test);
});
this.on(constants.EVENT_HOOK_END, function(hook) {
Expand Down
1 change: 1 addition & 0 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Test.prototype.clone = function() {
test.enableTimeouts(this.enableTimeouts());
test.retries(this.retries());
test.currentRetry(this.currentRetry());
test._retriedTest = this._retriedTest || this;
test.globals(this.globals());
test.parent = this.parent;
test.file = this.file;
Expand Down

0 comments on commit 98107a6

Please sign in to comment.