fix: read exit code of bun test in test runner
this will avoid duplicate error output
This commit is contained in:
@@ -23,6 +23,7 @@ const positionalArgs = Object.entries(args)
|
||||
console.log(formatCmd(args["dbCommand"]));
|
||||
const dbProcess = $({ quote: (arg) => arg })`${args["dbCommand"]}`.nothrow();
|
||||
|
||||
let exitCode = 0;
|
||||
try {
|
||||
$.env = {
|
||||
...getTestEnvVariables(),
|
||||
@@ -31,10 +32,13 @@ try {
|
||||
SHOULD_LOG_ERRORS: process.env["SHOULD_LOG_ERRORS"] ?? "true",
|
||||
};
|
||||
await $`bun db:migrate`.nothrow();
|
||||
await $({
|
||||
const testProcess = await $({
|
||||
verbose: true,
|
||||
quote: (arg) => arg,
|
||||
})`FORCE_COLOR=1 bun test ${positionalArgs.join(" ")}`;
|
||||
})`FORCE_COLOR=1 bun test ${positionalArgs.join(" ")}`.nothrow();
|
||||
exitCode = (await testProcess.exitCode) ?? 0;
|
||||
} finally {
|
||||
await dbProcess.kill("SIGINT");
|
||||
}
|
||||
|
||||
process.exit(exitCode);
|
||||
|
||||
Reference in New Issue
Block a user