Skip to content

Commit

Permalink
fix: deprecate --reporter basic
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 18, 2024
1 parent a2dcf2a commit 7b56195
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/vitest/src/node/reporters/basic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { File } from '@vitest/runner'
import type { Vitest } from '../core'
import c from 'tinyrainbow'
import { BaseReporter } from './base'

export class BasicReporter extends BaseReporter {
Expand All @@ -7,6 +9,16 @@ export class BasicReporter extends BaseReporter {
this.isTTY = false
}

onInit(ctx: Vitest) {
super.onInit(ctx)

ctx.logger.log(c.inverse(c.bold(c.yellow(' DEPRECATED '))), c.yellow(
`'basic' reporter is deprecated and will be removed in Vitest v3.\n`
+ `Remove 'basic' from 'reporters' option. To match 'basic' reporter 100%, use configuration:\n${
JSON.stringify({ test: { reporters: [['default', { summary: false }]] } }, null, 2)}`,
))
}

reportSummary(files: File[], errors: unknown[]) {
// non-tty mode doesn't add a new line
this.ctx.logger.log()
Expand Down

0 comments on commit 7b56195

Please sign in to comment.