MCPcopy Create free account
hub / github.com/blockmatic/basilic / waitForUrl

Function waitForUrl

apps/api/scripts/run-e2e-local.mjs:34–49  ·  view source on GitHub ↗
(url, timeoutMs = 60_000)

Source from the content-addressed store, hash-verified

32 (val.startsWith('"') && val.endsWith('"')) ||
33 (val.startsWith("'") && val.endsWith("'"))
34 ) {
35 val = val.slice(1, -1);
36 }
37
38 out[key] = val;
39 }
40 return out;
41}
42
43function waitForUrl(url, timeoutMs = 60_000) {
44 const start = Date.now();
45 return new Promise((resolve) => {
46 const check = async () => {
47 try {
48 const res = await fetch(url, { signal: AbortSignal.timeout(2000) });
49 if (res.ok || res.status === 307) {
50 return resolve(true);
51 }
52 } catch {

Callers 1

mainFunction · 0.70

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected