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

Function waitUntil

src/bridge/jwtUtils.test.ts:18–26  ·  view source on GitHub ↗
(predicate: () => boolean, timeoutMs = 100)

Source from the content-addressed store, hash-verified

16}
17
18async function waitUntil(predicate: () => boolean, timeoutMs = 100): Promise<void> {
19 const started = Date.now()
20 while (!predicate()) {
21 if (Date.now() - started > timeoutMs) {
22 throw new Error('Timed out waiting for condition')
23 }
24 await Bun.sleep(1)
25 }
26}
27
28describe('jwtUtils', () => {
29 it('decodes JWT payloads and expiry, including session-ingress prefixed tokens', () => {

Callers 1

jwtUtils.test.tsFile · 0.70

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected