MCPcopy
hub / github.com/librespeed/speedtest / waitForReady

Function waitForReady

tests/e2e/global-setup.js:5–19  ·  view source on GitHub ↗
(name, url, timeoutMs)

Source from the content-addressed store, hash-verified

3const COMPOSE_FILE = 'tests/docker-compose-playwright.yml';
4
5async function waitForReady(name, url, timeoutMs) {
6 const start = Date.now();
7 while (Date.now() - start < timeoutMs) {
8 try {
9 const response = await fetch(url, { redirect: 'manual' });
10 if (response.ok) {
11 return;
12 }
13 } catch {
14 // Retry until timeout.
15 }
16 await new Promise((resolve) => setTimeout(resolve, 1000));
17 }
18 throw new Error(`Timed out waiting for ${name} at ${url}`);
19}
20
21module.exports = async () => {
22 try {

Callers 1

global-setup.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected