MCPcopy Index your code
hub / github.com/anomalyco/opencode / waitFor

Function waitFor

packages/opencode/test/plugin/codex.test.ts:250–256  ·  view source on GitHub ↗
(predicate: () => boolean)

Source from the content-addressed store, hash-verified

248})
249
250async function waitFor(predicate: () => boolean) {
251 const started = Date.now()
252 while (!predicate()) {
253 if (Date.now() - started > 1_000) throw new Error("timed out waiting for condition")
254 await new Promise((resolve) => setTimeout(resolve, 1))
255 }
256}

Callers 1

codex.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected