Skip to content

Commit a045591

Browse files
AriPerkkiosheremet-va
authored andcommittedJan 27, 2023
feat: show active filename pattern on CLI
1 parent 61cf9a7 commit a045591

File tree

1 file changed

+4
-2
lines changed
  • packages/vitest/src/node/reporters

1 file changed

+4
-2
lines changed
 

‎packages/vitest/src/node/reporters/base.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,17 @@ export abstract class BaseReporter implements Reporter {
155155

156156
const BADGE = c.inverse(c.bold(c.blue(' RERUN ')))
157157
const TRIGGER = trigger ? c.dim(` ${this.relative(trigger)}`) : ''
158+
const FILENAME_PATTERN = this.ctx.filenamePattern ? `${BADGE_PADDING} ${c.dim('Filename pattern: ')}${c.blue(this.ctx.filenamePattern)}\n` : ''
159+
158160
if (files.length > 1) {
159161
// we need to figure out how to handle rerun all from stdin
160-
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER}\n`)
162+
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER}\n${FILENAME_PATTERN}`)
161163
this._lastRunCount = 0
162164
}
163165
else if (files.length === 1) {
164166
const rerun = this._filesInWatchMode.get(files[0]) ?? 1
165167
this._lastRunCount = rerun
166-
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}\n`)
168+
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}\n${FILENAME_PATTERN}`)
167169
}
168170

169171
this._timeStart = new Date()

0 commit comments

Comments
 (0)
Please sign in to comment.