(url: string)
| 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 | } |
no test coverage detected