Skip to content

Commit

Permalink
fix: trim input filename and test name (#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Jan 13, 2023
1 parent d622576 commit d3dcbdc
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit d3dcbdc

Please sign in to comment.