MCPcopy Create free account
hub / github.com/Noumena-Network/code / waitForFile

Function waitForFile

src/testing/replContractHarness.ts:169–178  ·  view source on GitHub ↗
(path: string, timeoutMs = 4000)

Source from the content-addressed store, hash-verified

167}
168
169export async function waitForFile(path: string, timeoutMs = 4000): Promise<void> {
170 const deadline = Date.now() + timeoutMs
171 while (Date.now() < deadline) {
172 if (existsSync(path)) {
173 return
174 }
175 await Bun.sleep(20)
176 }
177 throw new Error(`Timed out waiting for ${path}`)
178}
179
180export async function waitForText(
181 readText: () => string,

Callers

nothing calls this directly

Calls 2

existsSyncFunction · 0.90
sleepMethod · 0.80

Tested by

no test coverage detected