We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 018d64f commit 6ca0f1cCopy full SHA for 6ca0f1c
lib/cli.js
@@ -1,6 +1,7 @@
1
import fs from 'node:fs';
2
import path from 'node:path';
3
import process from 'node:process';
4
+import v8 from 'node:v8';
5
6
import arrify from 'arrify';
7
import figures from 'figures';
@@ -474,6 +475,12 @@ export default async function loadCli() { // eslint-disable-line complexity
474
475
reporter.startRun(plan);
476
477
plan.status.on('stateChange', evt => {
478
+ if (evt.type === 'end' || evt.type === 'interrupt') {
479
+ // Write out code coverage data when the run ends, lest a process
480
+ // interrupt causes it to be lost.
481
+ v8.takeCoverage();
482
+ }
483
+
484
if (evt.type === 'interrupt') {
485
reporter.endRun();
486
process.exit(1); // eslint-disable-line unicorn/no-process-exit
0 commit comments