-
-
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!(vitest): add "vitest list" command to output test names #4240
Conversation
❌ Deploy Preview for fastidious-cascaron-4ded94 failed.
|
Currently, it cannot exit for some reason (investigating). The output itself is not here yet. A few questions, @NullVoxPopuli:
|
seems fine for stdout
I don't think there is a need to stream any output if that's easier -- we wouldn't be running the tests themselves, so collecting everything to output at once should be very fast.
Potentially: #2901 |
Hi @sheremet-va! As the Vitest adapter maintainer for Neovim, I was thrilled about this PR. It seems like a game-changer for resolving issues related to test discovery, especially for parameters tests. Any chance you could provide a quick update on its status? I believe this integration is crucial for everyone developing tools upon Vitest. Your work is greatly appreciated! |
I am planning to have a release with changes to how pools are working in Vitest. Since Vitest API is experimental, it will not be a breaking change. I cannot give you the timing, but it will be after Vitest 1.0. |
It's implemented in another PR: #6013 |
Description
Closes #2901
This PR adds a new command:
It outputs the list of tests that would be running with passed-down filters. For example, like this:
By default, it just prints a list of names to stdout. You can pass down
--json
flag to output it as json (it will also include a filename as a separate field).--json
flag also accepts a path to the file:vitest list --json=./tests.json
This PR also adds a new config option called
collectors
which has the same interface as a reporter - so you can collect tests in real-time (onCollected
will be called after each test file is collected). This will probably be useful for tools like VS Code extension.To improve performance, Vitest ignores "isolate" flag (always set to
false
), unless it's overridden in CLI.TODO:
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:
.