Skip to content

Commit df7c410

Browse files
AriPerkkiosheremet-va
authored andcommittedJan 27, 2023
feat: show active test name pattern on CLI
1 parent a045591 commit df7c410

File tree

1 file changed

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

1 file changed

+3
-2
lines changed
 

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,17 @@ export abstract class BaseReporter implements Reporter {
156156
const BADGE = c.inverse(c.bold(c.blue(' RERUN ')))
157157
const TRIGGER = trigger ? c.dim(` ${this.relative(trigger)}`) : ''
158158
const FILENAME_PATTERN = this.ctx.filenamePattern ? `${BADGE_PADDING} ${c.dim('Filename pattern: ')}${c.blue(this.ctx.filenamePattern)}\n` : ''
159+
const TESTNAME_PATTERN = this.ctx.config.testNamePattern ? `${BADGE_PADDING} ${c.dim('Test name pattern: ')}${c.blue(String(this.ctx.config.testNamePattern))}\n` : ''
159160

160161
if (files.length > 1) {
161162
// we need to figure out how to handle rerun all from stdin
162-
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER}\n${FILENAME_PATTERN}`)
163+
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER}\n${FILENAME_PATTERN}${TESTNAME_PATTERN}`)
163164
this._lastRunCount = 0
164165
}
165166
else if (files.length === 1) {
166167
const rerun = this._filesInWatchMode.get(files[0]) ?? 1
167168
this._lastRunCount = rerun
168-
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}\n${FILENAME_PATTERN}`)
169+
this.ctx.logger.clearFullScreen(`\n${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}\n${FILENAME_PATTERN}${TESTNAME_PATTERN}`)
169170
}
170171

171172
this._timeStart = new Date()

0 commit comments

Comments
 (0)
Please sign in to comment.