forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: programmatic API cannot access retried test objects (mochajs#4181)
- Loading branch information
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
'use strict'; | ||
const assert = require('assert'); | ||
|
||
describe('retries', function () { | ||
this.retries(1); | ||
var times = 0; | ||
var self = this; | ||
|
||
it('should pass after 1 retry', function () { | ||
times++; | ||
if (times !== 2) { | ||
throw new Error('retry error ' + times); | ||
} | ||
}); | ||
|
||
it('check for updated `suite.tests`', function() { | ||
assert.equal(self.tests[0]._currentRetry, 1); | ||
assert.ok(self.tests[0]._retriedTest); | ||
assert.equal(self.tests[0].state, 'passed'); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters