Skip to content

Commit 9814124

Browse files
authoredNov 25, 2022
fix: exit with code 1, when type tests fail (#2378)
1 parent 5d7463e commit 9814124

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎packages/vitest/src/node/core.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,14 @@ export class Vitest {
160160
checker.onParseEnd(async ({ files, sourceErrors }) => {
161161
this.state.collectFiles(checker.getTestFiles())
162162
await this.report('onCollected')
163-
if (!files.length)
163+
if (!files.length) {
164164
this.logger.printNoTestFound()
165-
else
165+
}
166+
else {
167+
if (hasFailed(files))
168+
process.exitCode = 1
166169
await this.report('onFinished', files)
170+
}
167171
if (sourceErrors.length && !this.config.typecheck.ignoreSourceErrors) {
168172
process.exitCode = 1
169173
await this.logger.printSourceTypeErrors(sourceErrors)

0 commit comments

Comments
 (0)
Please sign in to comment.