MCPcopy
hub / github.com/vitest-dev/vitest / TestModuleMocker

Interface TestModuleMocker

packages/mocker/src/types.ts:34–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34export interface TestModuleMocker {
35 queueMock(
36 id: string,
37 importer: string,
38 factoryOrOptions?: ModuleMockFactory | ModuleMockOptions,
39 ): void
40 queueUnmock(id: string, importer: string): void
41 importActual<T>(
42 rawId: string,
43 importer: string,
44 callstack?: string[] | null,
45 ): Promise<T>
46 importMock(rawId: string, importer: string): Promise<any>
47 mockObject(
48 object: Record<string | symbol, any>,
49 moduleType?: 'automock' | 'autospy',
50 ): Record<string | symbol, any>
51 mockObject(
52 object: Record<string | symbol, any>,
53 mockExports: Record<string | symbol, any> | undefined,
54 moduleType?: 'automock' | 'autospy',
55 ): Record<string | symbol, any>
56 getMockContext(): ModuleMockContext
57 reset(): void
58}

Callers 36

mockFunction · 0.65
doMockFunction · 0.65
mockFunction · 0.65
doMockFunction · 0.65
unmockFunction · 0.65
doUnmockFunction · 0.65
unmockFunction · 0.65
doMockFunction · 0.65
doUnmockFunction · 0.65
mockFunction · 0.65
doMockFunction · 0.65
importActualFunction · 0.65

Implementers 2

ModuleMockerpackages/mocker/src/browser/mocker.ts
BareModuleMockerpackages/vitest/src/runtime/moduleRunn

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…