mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Throw when verdaccio did not start
This commit is contained in:
parent
b6c31e1a5a
commit
c50eac977b
1 changed files with 5 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ describe("E2E: Safe chain proxy", () => {
|
|||
// Start a local npm registry (verdaccio) inside the container
|
||||
container.dockerExec("npx -y verdaccio", true);
|
||||
|
||||
let verdaccioStarted = false;
|
||||
// Wait for verdaccio to be ready (max 60 seconds)
|
||||
for (let i = 0; i < 120; i++) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
|
|
@ -70,12 +71,16 @@ describe("E2E: Safe chain proxy", () => {
|
|||
"curl -I http://localhost:4873/"
|
||||
);
|
||||
if (curlOutput.includes("200 OK")) {
|
||||
verdaccioStarted = true;
|
||||
break;
|
||||
}
|
||||
} catch {
|
||||
// ignore, this means docker exec returned -1 and verdaccio is not yet ready
|
||||
}
|
||||
}
|
||||
if (!verdaccioStarted) {
|
||||
throw new Error("Verdaccio did not start in time");
|
||||
}
|
||||
|
||||
const shell = await container.openShell("bash");
|
||||
const result = await shell.runCommand(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue