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

Function waitForVisibleText

src/testing/ptyContractHarness.ts:275–287  ·  view source on GitHub ↗
(predicate, timeoutMs, label)

Source from the content-addressed store, hash-verified

273 return deferred.promise
274 },
275 async waitForVisibleText(predicate, timeoutMs, label) {
276 const deadline = Date.now() + timeoutMs
277 while (Date.now() < deadline) {
278 if (predicate(visibleText)) {
279 return visibleText
280 }
281 await Bun.sleep(20)
282 }
283
284 throw new Error(
285 `Timed out waiting for ${label} after ${timeoutMs}ms. Current visible PTY output:\n${visibleText}`,
286 )
287 },
288 async waitForVisibleRows(predicate, timeoutMs, label) {
289 const visibleTextSnapshot = await this.waitForVisibleText(
290 text => predicate(readVisibleRows(text)),

Callers

nothing calls this directly

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected