vitest-dev / vitest-dev/vitest
cli filtering in watch mode when `p` is pressed early
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
When running vitest in watch mode, filtering is not possible. It first runs all tests (which can take several minutes) before filtering works.
Expected behaviour
When pressing p to filter, test runs stop and it it possible to filter. This is how it works in jest.
Actual behaviour
When pressing p to filter while tests are running, tests do not stop and one needs to wait until all tests finished before it is possible to filter
Reproduction
System Info
System:
OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 2.46 GB / 7.65 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 20.3.1 - ~/.nvm/versions/node/v20.3.1/bin/node
Yarn: 3.5.1 - ~/.nvm/versions/node/v20.3.1/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v20.3.1/bin/npm
pnpm: 8.6.9 - ~/.nvm/versions/node/v20.3.1/bin/pnpm
Browsers:
Chrome: 115.0.5790.110
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz basic example and reproduce the behavior in Vitest watch mode by pressing p while tests are running. Trace the watch-mode filtering entry point and make the behavior match the expected result: the current test run stops and filtering becomes available immediately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100