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

CLI flag to test given file or file/line instead of filtering by pattern #5986

Closed
4 tasks done
LostKobrakai opened this issue Jun 27, 2024 · 1 comment
Closed
4 tasks done

Comments

@LostKobrakai
Copy link

LostKobrakai commented Jun 27, 2024

Clear and concise description of the problem

Coming from elixir I'm very used to running tests with mix test path/to/file_test.exs or mix test path/to/file_test.exs:20. That's very convenient to setup with an editor to have keyboard shortcuts to trigger either of them relative to where my cursor currently sits, which allows for a very rapid workflow between making changes and running tests.

vitest currently only offers test filtering by pattern, which doesn't really seem to support this usecase. Manually coming up and typing out the correct filter conditions is much more tedious.

Suggested solution

Have a CLI frag, which can receives a path. For a directory execute all test files in that directory, for a file path just that single file and potentially also be able to execute just the test at line 12 with path/to/file.test.js:12.

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

This is a duplicate of #5445

@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants