-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Using the new test.scoped() method only seems to work for the current suite and not any child suites.
The docs seem to indicate that this test should pass, but it fails:
const extendedTest = test.extend<{ foo: boolean }>({
foo: false,
});
describe('top level', () => {
extendedTest.scoped({ foo: true });
describe('second level', () => {
extendedTest('foo is true', ({ foo }) => {
expect(foo).toBe(true);
});
});
});Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-fedbxgs5?file=test%2Fsuite.test.ts
System Info
System:
OS: macOS 15.3.2
CPU: (10) arm64 Apple M1 Pro
Memory: 108.75 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/Library/NodeJS/bin/node
Yarn: 1.22.19 - ~/Library/NodeJS/bin/yarn
npm: 10.9.2 - ~/Library/NodeJS/bin/npm
Browsers:
Chrome: 134.0.6998.166
Edge: 134.0.3124.95
Safari: 18.3.1
npmPackages:
@vitest/coverage-v8: ^3.1.1 => 3.1.1
vitest: ^3.1.1 => 3.1.1Used 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.
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)