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

Function waitFor

src/ink/inkCompactBaseline.test.tsx:45–56  ·  view source on GitHub ↗
(
  predicate: () => boolean,
  message: string,
  timeoutMs = 1500,
)

Source from the content-addressed store, hash-verified

43}
44
45async function waitFor(
46 predicate: () => boolean,
47 message: string,
48 timeoutMs = 1500,
49): Promise<void> {
50 const deadline = Date.now() + timeoutMs
51 while (Date.now() < deadline) {
52 if (predicate()) return
53 await Bun.sleep(10)
54 }
55 throw new Error(message)
56}
57
58function TallMainScreenHarness({
59 suffix = '',

Callers 1

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected