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('...', () => {});
});
});
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:
Suggested solution
Tests with
onlyshould 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