-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support specifying a line number when filtering tests #5445
Comments
In elixir it'll run the test, which starts the closest above the supplied line. That's less brittle in the context of line changes (e.g. removing an |
I'm interested in picking this up.
Nevermind, I was way off 🥲 |
The implementation in #6411 only supports tests, it would be nice to also support filtering suites: describe('suite', () => {
test('nested 1')
test('nested 2')
}) vitest example.test.ts:1 |
Clear and concise description of the problem
Right now it's quite cumbersome to filter out tests when using a Vitest CLI. You need to know the name and the file:
It fails if there are multiple tests that have the same pattern, so you are forced to use the full name manually:
Suggested solution
Vitest 1.4.0 introduced
includeTaskLocation
option that adds alocation
property to every test. With this information, we can filter tests by the line number:Alternative
No response
Additional context
I am not sure what should happen when the line doesn't exist or there is no test at that line. Currently, we only know the location of a test, and we don't know when the body of a test ends, so it's tricky to implement a range support.
I think we should:
test/basic.test.ts:20-30
)Validations
The text was updated successfully, but these errors were encountered: