Skip to content

Commit cba472b

Browse files
committed
test: type-check-coverage: callWhenTestsEnds
1 parent 76e755c commit cba472b

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

test/type-check-coverage.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import process from 'node:process';
2-
import {isOnlyTests} from 'supertape';
1+
import {callWhenTestsEnds} from 'supertape';
32
import {getCoverage} from '#type-checker/instrument';
43
import {report} from '#type-checker/report';
54

6-
if (process.env.TYPE_CHECK)
7-
process.on('exit', () => {
8-
if (isOnlyTests())
9-
return;
10-
11-
const coverage = getCoverage();
12-
const [code, output] = report(coverage);
13-
14-
console.log(output);
15-
process.exitCode = code;
16-
});
5+
callWhenTestsEnds('TYPE_CHECK', () => {
6+
const coverage = getCoverage();
7+
const [code, output] = report(coverage);
8+
9+
console.log(output);
10+
11+
return code;
12+
});

0 commit comments

Comments
 (0)