Skip to content

Commit

Permalink
fix: exit with code 1, when type tests fail (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Nov 25, 2022
1 parent 5d7463e commit 9814124
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vitest/src/node/core.ts
Expand Up @@ -160,10 +160,14 @@ export class Vitest {
checker.onParseEnd(async ({ files, sourceErrors }) => {
this.state.collectFiles(checker.getTestFiles())
await this.report('onCollected')
if (!files.length)
if (!files.length) {
this.logger.printNoTestFound()
else
}
else {
if (hasFailed(files))
process.exitCode = 1
await this.report('onFinished', files)
}
if (sourceErrors.length && !this.config.typecheck.ignoreSourceErrors) {
process.exitCode = 1
await this.logger.printSourceTypeErrors(sourceErrors)
Expand Down

0 comments on commit 9814124

Please sign in to comment.