Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trim input filename and test name #2650

Merged
merged 2 commits into from Jan 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/vitest/src/node/stdin.ts
Expand Up @@ -83,7 +83,7 @@ export function registerConsoleShortcuts(ctx: Vitest) {
message: 'Input test name pattern (RegExp)',
initial: ctx.config.testNamePattern?.source || '',
}])
await ctx.changeNamePattern(filter, undefined, 'change pattern')
await ctx.changeNamePattern(filter.trim(), undefined, 'change pattern')
on()
}

Expand All @@ -95,8 +95,8 @@ export function registerConsoleShortcuts(ctx: Vitest) {
message: 'Input filename pattern',
initial: latestFilename,
}])
latestFilename = filter
await ctx.changeFilenamePattern(filter)
latestFilename = filter.trim()
await ctx.changeFilenamePattern(filter.trim())
on()
}

Expand Down