-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Clear and concise description of the problem
Currently if you have an test.only inside a description.only all the tests under the description run. For example:
import { describe, it, expect } from 'vitest';
describe('My Component', () => {
describe.only('Only run this suite of tests', () => {
test.only('should be the only test that runs', () => {
expect(true).toBe(true);
});
test('should not run because the previous test has an only', () => {
throw new Error('This test should not run');
});
});
describe('This suite of tests should never run and, correctly, do not', () => {
test('...', () => {});
test('...', () => {});
test('...', () => {});
});
});
Suggested solution
Tests with only should be the only test to run. This is the way Mocha works and is very useful when developing and debugging complex test suites.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)