GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(types): don't import node.js dependent types in vitest/browser (#… · vitest-dev/vitest@332afa0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/vitest/src/runtime
    • moduleRunner
      • moduleMocker.ts
      • types.ts
    • setup-common.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/vitest/src/runtime/moduleRunner/moduleMocker.ts‎

Copy file name to clipboardExpand all lines: packages/vitest/src/runtime/moduleRunner/moduleMocker.ts
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ export class VitestMocker {
527527

528528
declare module 'vite/module-runner' {
529529
interface EvaluatedModuleNode {
530+
/**
531+
* @internal
532+
*/
530533
mockedExports?: Record<string, any>
531534
}
532535
}
Collapse file

‎packages/vitest/src/runtime/moduleRunner/types.ts‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface PublicModuleRunner {
2+
import: (id: string) => Promise<any>
3+
}
Collapse file

‎packages/vitest/src/runtime/setup-common.ts‎

Copy file name to clipboardExpand all lines: packages/vitest/src/runtime/setup-common.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { DiffOptions } from '@vitest/expect'
22
import type { SnapshotSerializer } from '@vitest/snapshot'
33
import type { SerializedDiffOptions } from '@vitest/utils/diff'
44
import type { SerializedConfig } from './config'
5-
import type { VitestModuleRunner } from './moduleRunner/moduleRunner'
5+
import type { PublicModuleRunner } from './moduleRunner/types'
66
import { addSerializer } from '@vitest/snapshot'
77
import { setSafeTimers } from '@vitest/utils/timers'
88
import { getWorkerState } from './utils'
@@ -43,7 +43,7 @@ function setupEnv(env: Record<string, any>) {
4343

4444
export async function loadDiffConfig(
4545
config: SerializedConfig,
46-
moduleRunner: VitestModuleRunner,
46+
moduleRunner: PublicModuleRunner,
4747
): Promise<SerializedDiffOptions | undefined> {
4848
if (typeof config.diff === 'object') {
4949
return config.diff
@@ -70,7 +70,7 @@ export async function loadDiffConfig(
7070

7171
export async function loadSnapshotSerializers(
7272
config: SerializedConfig,
73-
moduleRunner: VitestModuleRunner,
73+
moduleRunner: PublicModuleRunner,
7474
): Promise<void> {
7575
const files = config.snapshotSerializers
7676

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.