diff --git a/packages/vitest/src/runtime/workers/base.ts b/packages/vitest/src/runtime/workers/base.ts index 1682383f9b16..964cca9ab761 100644 --- a/packages/vitest/src/runtime/workers/base.ts +++ b/packages/vitest/src/runtime/workers/base.ts @@ -7,6 +7,7 @@ import { provideWorkerState } from '../utils' let _viteNode: VitestExecutor const moduleCache = new ModuleCacheMap() +const moduleExecutionInfo = new Map() async function startViteNode(options: ContextExecutorOptions) { if (_viteNode) { @@ -21,6 +22,7 @@ export async function runBaseTests(method: 'run' | 'collect', state: WorkerGloba const { ctx } = state // state has new context, but we want to reuse existing ones state.moduleCache = moduleCache + state.moduleExecutionInfo = moduleExecutionInfo provideWorkerState(globalThis, state) diff --git a/test/coverage-test/test/isolation.test.ts b/test/coverage-test/test/isolation.test.ts index 0757051a202b..2d464d4b51aa 100644 --- a/test/coverage-test/test/isolation.test.ts +++ b/test/coverage-test/test/isolation.test.ts @@ -48,9 +48,8 @@ for (const isolate of [true, false]) { if (isV8Provider()) { expect(summary).toStrictEqual({ '/fixtures/src/branch.ts': { - // FIXME: this should specify exact numbers - branches: expect.any(String), - functions: expect.any(String), + branches: '3/3 (100%)', + functions: '1/1 (100%)', lines: '6/6 (100%)', statements: '6/6 (100%)', },