Skip to content

Commit

Permalink
Add number of timeouts in test summary
Browse files Browse the repository at this point in the history
Fixes #2639.
  • Loading branch information
il3ven committed May 16, 2022
1 parent abfef8e commit 714c474
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/reporters/default.js
Expand Up @@ -660,6 +660,10 @@ export default class Reporter {
this.lineWriter.writeLine(colors.error(`${this.stats.uncaughtExceptions} uncaught ${plur('exception', this.stats.uncaughtExceptions)}`));
}

if (this.stats.timeouts > 0) {
this.lineWriter.writeLine(colors.error(`${this.stats.timeouts} ${plur('test', this.stats.timeouts)} remained pending after a timeout`));
}

if (this.previousFailures > 0) {
this.lineWriter.writeLine(colors.error(`${this.previousFailures} previous ${plur('failure', this.previousFailures)} in test files that were not rerun`));
}
Expand Down
5 changes: 4 additions & 1 deletion lib/run-status.js
Expand Up @@ -125,7 +125,10 @@ export default class RunStatus extends Emittery {
case 'timeout':
event.pendingTests = this.pendingTests;
this.pendingTests = new Map();
stats.timeouts++;
for (const testsInFile of event.pendingTests.values()) {
stats.timeouts += testsInFile.size;
}

break;
case 'interrupt':
event.pendingTests = this.pendingTests;
Expand Down
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v12.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v14.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v16.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinmultiplefiles.v17.log
Expand Up @@ -30,4 +30,5 @@
─

4 tests passed
5 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v12.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v14.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v16.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutinsinglefile.v17.log
Expand Up @@ -16,4 +16,5 @@
─

2 tests passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v12.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v14.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v16.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator
1 change: 1 addition & 0 deletions test-tap/reporters/default.timeoutwithmatch.v17.log
Expand Up @@ -14,4 +14,5 @@
─

1 test passed
2 tests remained pending after a timeout
---tty-stream-chunk-separator

0 comments on commit 714c474

Please sign in to comment.