MCPcopy Create free account
hub / github.com/Effect-TS/effect / waitFor

Function waitFor

packages/sql/pg/test/PgPool.in-process.test.ts:42–48  ·  view source on GitHub ↗
(predicate: () => boolean)

Source from the content-addressed store, hash-verified

40 ])
41
42const waitFor = (predicate: () => boolean) =>
43 Effect.promise(async () => {
44 for (let i = 0; i < 100 && !predicate(); i++) {
45 await new Promise((resolve) => setTimeout(resolve, 10))
46 }
47 assert.ok(predicate(), "background acquisition did not start")
48 })
49
50describe("PgPool failed startup", () => {
51 it.live(

Calls 1

predicateFunction · 0.85

Tested by

no test coverage detected