Skip to content

Commit 98595da

Browse files
tymfearDaudov, Tymur
and
Daudov, Tymur
authoredDec 31, 2020
Fix timeout reporting in TAP reporter
Fixes #2612 Co-authored-by: Daudov, Tymur <tymur.daudov@f-secure.com>
1 parent 3fe4c40 commit 98595da

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎lib/reporters/tap.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ class TapReporter {
131131
}
132132
}
133133

134+
writeTimeout(evt) {
135+
const err = new Error(`Exited because no new tests completed within the last ${evt.period}ms of inactivity`);
136+
137+
for (const [testFile, tests] of evt.pendingTests) {
138+
for (const title of tests) {
139+
this.writeTest({testFile, title, err}, {passed: false, todo: false, skip: false});
140+
}
141+
}
142+
}
143+
134144
consumeStateChange(evt) { // eslint-disable-line complexity
135145
const fileStats = this.stats && evt.testFile ? this.stats.byFile.get(evt.testFile) : null;
136146

@@ -172,7 +182,7 @@ class TapReporter {
172182
this.writeTest(evt, {passed: true, todo: false, skip: false});
173183
break;
174184
case 'timeout':
175-
this.writeCrash(evt, `Exited because no new tests completed within the last ${evt.period}ms of inactivity`);
185+
this.writeTimeout(evt);
176186
break;
177187
case 'uncaught-exception':
178188
this.writeCrash(evt);

0 commit comments

Comments
 (0)
Please sign in to comment.