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

Function resolveManualMock

packages/browser/src/client/client.ts:96–110  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

94 cdp.emit(event, payload)
95 },
96 async resolveManualMock(url: string) {
97 // @ts-expect-error not typed global API
98 const mocker = globalThis.__vitest_mocker__ as ModuleMocker | undefined
99 const responseId = getBrowserState().sessionId
100 if (!mocker) {
101 return { url, keys: [], responseId }
102 }
103 const exports = await mocker.resolveFactoryModule(url)
104 const keys = Object.keys(exports)
105 return {
106 url,
107 keys,
108 responseId,
109 }
110 },
111 },
112 {
113 post: msg => ctx.ws.send(msg),

Callers

nothing calls this directly

Calls 3

getBrowserStateFunction · 0.90
resolveFactoryModuleMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected