waitFor
export const waitFor = async (cond: () => boolean | Promise<boolean>, ms = 20000) => { for (const end = Date.now() + ms; Date.now() < end; await new Promise((r) => setTimeout(r, 150))) if (await cond()) return; throw new Error("timed out waiting"); }
used by
- tcmts.cli.test.e2e.prod.testAssetsKeepTheirUrlsAcrossDeploys
- tcmts.cli.test.e2e.prod.testBuildDuringStart
- tcmts.cli.test.e2e.prod.testBuildStartDeployRollBack
- tcmts.cli.test.e2e.prod.testDeployedChunksArriveAsDifferences
- tcmts.cli.test.e2e.prod.testKeptBuildWithoutItsCode
- tcmts.cli.test.e2e.prod.testPushDeploys