Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
Something went wrong. Try again.
751 B · 24 lines
TypeScript
at v2
12345678910111213141516171819202122232425import { VitestExecutor } from 'vitest/execute'
export class InlineWorkerRunner extends VitestExecutor { constructor(options: any, 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>) { const ctx = super.prepareContext(context) // not supported for now, we can't synchronously load modules return Object.assign(ctx, this.context, { importScripts, }) }}
function importScripts() { throw new Error( '[vitest] `importScripts` is not supported in Vite workers. Please, consider using `import` instead.', )}