Skip to content

Commit

Permalink
Revert "refactor: typing ExecuteOptions"
Browse files Browse the repository at this point in the history
This reverts commit 2447160.
  • Loading branch information
hi-ogawa committed Oct 3, 2024
1 parent 11064de commit 8baf1cb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/vitest/src/public/execute.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { VitestExecutor, ExecuteOptions } from '../runtime/execute'
export { VitestExecutor } from '../runtime/execute'
3 changes: 1 addition & 2 deletions packages/web-worker/src/runner.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { ExecuteOptions } from 'vitest/execute'
import { VitestExecutor } from 'vitest/execute'

export class InlineWorkerRunner extends VitestExecutor {
constructor(options: ExecuteOptions, private context: any) {
constructor(options: any, private context: any) {
// share the same mocker as main executor
const mocker = (globalThis as any).__vitest_mocker__
super(options)
Expand Down
2 changes: 1 addition & 1 deletion packages/web-worker/src/shared-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function createSharedWorkerConstructor(): typeof SharedWorker {

return runner.executeFile(fsPath).then(() => {
// worker should be new every time, invalidate its sub dependency
runnerOptions.moduleCache!.invalidateSubDepTree([
runnerOptions.moduleCache.invalidateSubDepTree([
fsPath,
runner.mocker.getMockPath(fsPath),
])
Expand Down
3 changes: 1 addition & 2 deletions packages/web-worker/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { readFileSync as _readFileSync } from 'node:fs'
import type { WorkerGlobalState } from 'vitest'
import ponyfillStructuredClone from '@ungap/structured-clone'
import createDebug from 'debug'
import type { ExecuteOptions } from 'vitest/execute'
import type { CloneOption } from './types'

// keep the reference in case it was mocked
Expand Down Expand Up @@ -80,7 +79,7 @@ export function createMessageEvent(
}
}

export function getRunnerOptions(): ExecuteOptions {
export function getRunnerOptions(): any {
const state = getWorkerState()
const { config, rpc, moduleCache } = state

Expand Down
2 changes: 1 addition & 1 deletion packages/web-worker/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function createWorkerConstructor(

return runner.executeFile(fsPath).then(() => {
// worker should be new every time, invalidate its sub dependency
runnerOptions.moduleCache!.invalidateSubDepTree([
runnerOptions.moduleCache.invalidateSubDepTree([
fsPath,
runner.mocker.getMockPath(fsPath),
])
Expand Down

0 comments on commit 8baf1cb

Please sign in to comment.