Skip to content

Commit

Permalink
fix: always show filters, when no tests found (#1124)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
sheremet-va and antfu committed Apr 10, 2022
1 parent e6fd661 commit ce53037
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/vitest/src/node/core.ts
Expand Up @@ -121,20 +121,19 @@ export class Vitest {

if (!files.length) {
const exitCode = this.config.passWithNoTests ? 0 : 1
if (this.config.passWithNoTests) {
this.log('No test files found, exiting with code 0\n')
}
else {
const comma = c.dim(', ')
if (filters?.length)
this.console.error(c.dim('filter: ') + c.yellow(filters.join(comma)))
if (this.config.include)
this.console.error(c.dim('include: ') + c.yellow(this.config.include.join(comma)))
if (this.config.watchIgnore)
this.console.error(c.dim('ignore: ') + c.yellow(this.config.watchIgnore.join(comma)))

const comma = c.dim(', ')
if (filters?.length)
this.console.error(c.dim('filter: ') + c.yellow(filters.join(comma)))
if (this.config.include)
this.console.error(c.dim('include: ') + c.yellow(this.config.include.join(comma)))
if (this.config.watchIgnore)
this.console.error(c.dim('ignore: ') + c.yellow(this.config.watchIgnore.join(comma)))

if (this.config.passWithNoTests)
this.log('No test files found, exiting with code 0\n')
else
this.error(c.red('\nNo test files found, exiting with code 1'))
}

process.exit(exitCode)
}
Expand Down

0 comments on commit ce53037

Please sign in to comment.