Skip to content

Commit 714c474

Browse files
authored
Add number of timeouts in test summary
Fixes #2639.
1 parent abfef8e commit 714c474

14 files changed

+20
-1
lines changed

lib/reporters/default.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ export default class Reporter {
660660
this.lineWriter.writeLine(colors.error(`${this.stats.uncaughtExceptions} uncaught ${plur('exception', this.stats.uncaughtExceptions)}`));
661661
}
662662

663+
if (this.stats.timeouts > 0) {
664+
this.lineWriter.writeLine(colors.error(`${this.stats.timeouts} ${plur('test', this.stats.timeouts)} remained pending after a timeout`));
665+
}
666+
663667
if (this.previousFailures > 0) {
664668
this.lineWriter.writeLine(colors.error(`${this.previousFailures} previous ${plur('failure', this.previousFailures)} in test files that were not rerun`));
665669
}

lib/run-status.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ export default class RunStatus extends Emittery {
125125
case 'timeout':
126126
event.pendingTests = this.pendingTests;
127127
this.pendingTests = new Map();
128-
stats.timeouts++;
128+
for (const testsInFile of event.pendingTests.values()) {
129+
stats.timeouts += testsInFile.size;
130+
}
131+
129132
break;
130133
case 'interrupt':
131134
event.pendingTests = this.pendingTests;

test-tap/reporters/default.timeoutinmultiplefiles.v12.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
─
3131

3232
4 tests passed
33+
5 tests remained pending after a timeout
3334
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinmultiplefiles.v14.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
─
3131

3232
4 tests passed
33+
5 tests remained pending after a timeout
3334
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinmultiplefiles.v16.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
─
3131

3232
4 tests passed
33+
5 tests remained pending after a timeout
3334
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinmultiplefiles.v17.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
─
3131

3232
4 tests passed
33+
5 tests remained pending after a timeout
3334
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinsinglefile.v12.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
─
1717

1818
2 tests passed
19+
2 tests remained pending after a timeout
1920
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinsinglefile.v14.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
─
1717

1818
2 tests passed
19+
2 tests remained pending after a timeout
1920
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinsinglefile.v16.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
─
1717

1818
2 tests passed
19+
2 tests remained pending after a timeout
1920
---tty-stream-chunk-separator

test-tap/reporters/default.timeoutinsinglefile.v17.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
─
1717

1818
2 tests passed
19+
2 tests remained pending after a timeout
1920
---tty-stream-chunk-separator

0 commit comments

Comments
 (0)