Skip to content

Commit 7493701

Browse files
committed
fix: ensure we set non-0 exit code on errors node:test describe()
1 parent d6835c6 commit 7493701

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

bin/reporter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export default async function nodeTestReporterExodus(source) {
154154
assert(path.pop() === data.name)
155155
break
156156
case 'test:fail':
157+
if (!process.exitCode) process.exitCode = 1 // node:test might not set this on errors in describe()
157158
if (!pskip(path)) print(`${color('✖ FAIL ', 'red')}${pathstr(path)}${formatSuffix(data)}`)
158159
if (path.length > 0) assert(path.pop() === data.name) // afterAll can generate failures too, with an empty path
159160
if (!data.todo) failedFiles.add(file)

0 commit comments

Comments
 (0)