Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

type check before calling retriedTest()

juergba13e94b1511ff
diff --git a/lib/runner.js b/lib/runner.js
index 60b55373..aabffda9 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -134,7 +134,7 @@ function Runner(suite, delay) {
this.total = suite.total();
this.failures = 0;
this.on(constants.EVENT_TEST_END, function(test) {
- if (test.retriedTest() && test.parent) {
+ if (test.type === 'test' && test.retriedTest() && test.parent) {
var idx =
test.parent.tests && test.parent.tests.indexOf(test.retriedTest());
if (idx > -1) test.parent.tests[idx] = test;