Describe the bug
When fixtures with different scopes are used, specifically, one with a 'worker' scope and another with the default 'test' scope (and the 'auto' flag set to 'true'), the fixture with the 'worker' scope cannot be accessed or utilized within a "beforeAll" hook.
Reproduction
import { describe, test } from 'vitest';
const it = test
.extend('fakeTestFixture', { auto: true }, () => {})
.extend('fakeWorkerFixture', { scope: 'worker' }, () => {
console.log('fakeWorkerFixture');
return 'hello';
});
describe('scope mismatch', () => {
it.beforeAll(({ fakeWorkerFixture }) => {
console.log('before all ' + fakeWorkerFixture);
});
it('should work', () => {});
});
https://stackblitz.com/edit/vitest-dev-vitest-vp84tpwo?file=test%2Fscope.test.ts,package-lock.json&initialPath=__vitest__/
System Info
System:
OS: macOS 26.3.1
CPU: (12) arm64 Apple M3 Pro
Memory: 262.59 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.10.0 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/node
Yarn: 4.12.0 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/yarn
npm: 11.6.1 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/npm
bun: 1.2.4 - /Users/avictoor/.bun/bin/bun
Browsers:
Chrome: 146.0.7680.165
Edge: 146.0.3856.84
Firefox: 149.0
Safari: 26.3.1
Used Package Manager
npm
Validations
Describe the bug
When fixtures with different scopes are used, specifically, one with a 'worker' scope and another with the default 'test' scope (and the 'auto' flag set to 'true'), the fixture with the 'worker' scope cannot be accessed or utilized within a "beforeAll" hook.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-vp84tpwo?file=test%2Fscope.test.ts,package-lock.json&initialPath=__vitest__/
System Info
System: OS: macOS 26.3.1 CPU: (12) arm64 Apple M3 Pro Memory: 262.59 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.10.0 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/node Yarn: 4.12.0 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/yarn npm: 11.6.1 - /Users/avictoor/.nvm/versions/node/v24.10.0/bin/npm bun: 1.2.4 - /Users/avictoor/.bun/bin/bun Browsers: Chrome: 146.0.7680.165 Edge: 146.0.3856.84 Firefox: 149.0 Safari: 26.3.1Used Package Manager
npm
Validations