-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(cli): show test "path" when filtering #6649
base: main
Are you sure you want to change the base?
Conversation
packages/vitest/src/node/stdin.ts
Outdated
} | ||
else { | ||
for (const task of t.tasks) { | ||
yield * traverseFilteredTestNames([...stack, task.name], filter, task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add parentName: string
instead recreating the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest commit also fixes duplicate test names - check the screenshot, t1
appears twice
@@ -9,13 +9,18 @@ const MAX_RESULT_COUNT = 10 | |||
const SELECTION_MAX_INDEX = 7 | |||
const ESC = '\u001B[' | |||
|
|||
type FilterFunc = (keyword: string) => Promise<string[]> | string[] | |||
export interface FilterType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to FilterObject or FilterItem and replace name with key.
This way when we add the x
command to run a test/suite we we just use key with the corresponding id.
Description
This PR is related to filtering from command line here: #6641 (compare screenshots there and here)
This PR allows declare the watcher filter using a new interface to display the list with the test path removing duplicates files when using workspaces. Right now, filtering tests will run any test in any files and workspace matching the name of the selected item (test name).
NOTE: we should add a new
runById
to allow run only a test (the UI will use it)filtering from command line with this PR
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.