Skip to content

Commit

Permalink
Merge pull request #40 from line/fix/exit-with-1-when-test-fails
Browse files Browse the repository at this point in the history
chore: exit with 1 when test fails
  • Loading branch information
kazushisan authored Sep 23, 2024
2 parents 06d001c + 68baeb9 commit 5009ab2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* global process */
import { run } from 'node:test';
import { stdout } from 'node:process';
import { spec } from 'node:test/reporters';

run({
globPatterns: ['lib/**/*.test.ts', 'test/**/*.test.ts'],
})
.on('test:fail', () => {
process.exitCode = 1;
})
.compose(spec)
.pipe(stdout);
.pipe(process.stdout);

0 comments on commit 5009ab2

Please sign in to comment.