Skip to content

Commit 5757e92

Browse files
committed
edit 'test/setTests' - set coverage reporter default to 'spec' if stdout is TTY, else use 'tap'
Signed-off-by: StoneyDSP <nathanjhood@googlemail.com>
1 parent 06b90b5 commit 5757e92

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/setupTests.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ const options: Readonly<NodeTestRunnerOptions> = Object.freeze<NodeTestRunnerOpt
3838
console.error(testFail);
3939
process.exitCode = 1; // must be != 0, to avoid false positives in CI pipelines
4040
});
41-
// coverage reporter: spec
42-
testsStream.compose(reporters.spec).pipe(process.stdout);
41+
// coverage reporter
42+
const isTTY = process.stdout.isTTY;
43+
const reporter = isTTY ? reporters.spec : reporters.tap;
44+
testsStream.compose(reporter).pipe(process.stdout);
4345
},
4446
// testNamePatterns: [
4547
// "**/*.test.?(c|m)js",

0 commit comments

Comments
 (0)