MCPcopy
hub / github.com/prisma/prisma / waitFor

Function waitFor

packages/client/tests/functional/_utils/tests/waitFor.ts:15–30  ·  view source on GitHub ↗
(cb: () => void | Promise<void>)

Source from the content-addressed store, hash-verified

13 * @param cb
14 */
15export async function waitFor(cb: () => void | Promise<void>) {
16 const start = performance.now()
17 let error: unknown = null
18
19 while (performance.now() - start < MAX_WAIT) {
20 try {
21 await cb()
22 return
23 } catch (e) {
24 error = e
25 await delay(100)
26 }
27 }
28
29 throw error
30}

Callers 13

tests.tsFile · 0.90
testIsolationLevelFunction · 0.90
tests.tsFile · 0.90
tests.tsFile · 0.90
expectQueryCountAtLeastFunction · 0.90
tests.tsFile · 0.90
tests.tsFile · 0.90
tests.tsFile · 0.90
query.tsFile · 0.90
model.tsFile · 0.90
tests.tsFile · 0.90

Calls 1

delayFunction · 0.90

Tested by

no test coverage detected