diff --git a/lib/reporters/tap.js b/lib/reporters/tap.js index b7bda3067..d3d4a4603 100644 --- a/lib/reporters/tap.js +++ b/lib/reporters/tap.js @@ -131,6 +131,16 @@ class TapReporter { } } + writeTimeout(evt) { + const err = new Error(`Exited because no new tests completed within the last ${evt.period}ms of inactivity`); + + for (const [testFile, tests] of evt.pendingTests) { + for (const title of tests) { + this.writeTest({testFile, title, err}, {passed: false, todo: false, skip: false}); + } + } + } + consumeStateChange(evt) { // eslint-disable-line complexity const fileStats = this.stats && evt.testFile ? this.stats.byFile.get(evt.testFile) : null; @@ -172,7 +182,7 @@ class TapReporter { this.writeTest(evt, {passed: true, todo: false, skip: false}); break; case 'timeout': - this.writeCrash(evt, `Exited because no new tests completed within the last ${evt.period}ms of inactivity`); + this.writeTimeout(evt); break; case 'uncaught-exception': this.writeCrash(evt);