Skip to content

Commit

Permalink
fix(web-worker): reuse main executor mocker
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Oct 3, 2024
1 parent 2447160 commit 11064de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/web-worker/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { VitestExecutor } from 'vitest/execute'

export class InlineWorkerRunner extends VitestExecutor {
constructor(options: ExecuteOptions, private context: any) {
// share the same mocker as main executor
const mocker = (globalThis as any).__vitest_mocker__
super(options)
this.mocker = (globalThis as any).__vitest_mocker__ = mocker
}

prepareContext(context: Record<string, any>) {
Expand Down

0 comments on commit 11064de

Please sign in to comment.