MCPcopy
hub / github.com/vitejs/vite / waitForWatcher

Function waitForWatcher

packages/vite/src/node/ssr/runtime/__tests__/utils.ts:24–32  ·  view source on GitHub ↗
(server: ViteDevServer)

Source from the content-addressed store, hash-verified

22 runnerConfig: ServerModuleRunnerOptions = {},
23): Promise<TestAPI<TestClient>> {
24 function waitForWatcher(server: ViteDevServer) {
25 return new Promise<void>((resolve) => {
26 if ((server.watcher as any)._readyEmitted) {
27 resolve()
28 } else {
29 server.watcher.once('ready', () => resolve())
30 }
31 })
32 }
33
34 beforeEach<TestClient>(async (t) => {
35 // @ts-ignore

Callers 1

createModuleRunnerTesterFunction · 0.70

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected