Skip to content

Commit

Permalink
add more error reporting to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Sep 10, 2024
1 parent 66dd152 commit 21e810c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ export async function runCommandInContainer(
docker.modem.demuxStream(attach, stdout, stderr);
await container.start();
const wait = (await container.wait()) as { StatusCode: number };
if (wait.StatusCode !== 0)
throw new Error(`Command failed with status code ${wait.StatusCode}`);
if (wait.StatusCode !== 0) {
throw new Error(`Command failed with status code ${wait.StatusCode}\n` +
`stdout:\n${stdout}\n\n` +
`stderr:\n${stderr}`);
}
return { stdout: stdout.string, stderr: stderr.string };
}

Expand Down

0 comments on commit 21e810c

Please sign in to comment.