MCPcopy Create free account
hub / github.com/coder/mux / waitForRouterCondition

Function waitForRouterCondition

src/node/orpc/router.test.ts:59–71  ·  view source on GitHub ↗
(
  description: string,
  predicate: () => boolean
)

Source from the content-addressed store, hash-verified

57});
58
59async function waitForRouterCondition(
60 description: string,
61 predicate: () => boolean
62): Promise<void> {
63 const deadline = Date.now() + 1_000;
64 while (Date.now() < deadline) {
65 if (predicate()) {
66 return;
67 }
68 await new Promise((resolve) => setTimeout(resolve, 10));
69 }
70 throw new Error(`Timed out waiting for ${description}`);
71}
72
73async function waitForRouterWorkflowStatus(
74 client: {

Callers 1

router.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected