prefer-test-fixture-reuse
Reuse a requested test fixture instead of constructing another instance of its class.
Why
A second constructor bypasses the fixture's overrides, caching, configuration and cleanup ownership.
Fix
Use the requested fixture. Supply a typed factory fixture when a test requires different configuration or multiple independent instances.
Examples
import { test as base } from "vitest";class Store {}const test = base.extend({ store: async ({}, use) => { await use(new Store()); },});test("reads", ({ store }) => { const other = new Store(); expect(other).toBeDefined();});import { test as base } from "vitest";class Store {}const test = base.extend({ store: async ({}, use) => { await use(new Store()); },});test("reads", ({ store }) => { expect(store).toBeDefined();});