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

Function getFactoryExports

packages/mocker/src/node/interceptorPlugin.ts:85–99  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

83 })
84
85 function getFactoryExports(url: string) {
86 server.ws.send('vitest:interceptor:resolve', url)
87 let timeout: NodeJS.Timeout
88 return new Promise<string[]>((resolve, reject) => {
89 timeout = setTimeout(() => {
90 reject(new Error(`Timeout while waiting for factory exports of ${url}`))
91 }, 10_000)
92 server.ws.on('vitest:interceptor:resolved', ({ url: resolvedUrl, keys }: { url: string; keys: string[] }) => {
93 if (resolvedUrl === url) {
94 clearTimeout(timeout)
95 resolve(keys)
96 }
97 })
98 })
99 }
100 },
101 }
102}

Callers 1

configureServerFunction · 0.85

Calls 4

rejectFunction · 0.50
resolveFunction · 0.50
sendMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected