fix: test runner not exiting with code 1 when test fails
This commit is contained in:
@@ -23,16 +23,18 @@ const positionalArgs = Object.entries(args)
|
||||
console.log(formatCmd(args["dbCommand"]));
|
||||
const dbProcess = $({ quote: (arg) => arg })`${args["dbCommand"]}`.nothrow();
|
||||
|
||||
$.env = {
|
||||
...getTestEnvVariables(),
|
||||
PATH: process.env["PATH"],
|
||||
HOME: process.env["HOME"],
|
||||
SHOULD_LOG_ERRORS: process.env["SHOULD_LOG_ERRORS"] ?? "true",
|
||||
};
|
||||
await $`bun db:migrate`.nothrow();
|
||||
await $({
|
||||
verbose: true,
|
||||
quote: (arg) => arg,
|
||||
})`FORCE_COLOR=1 bun test ${positionalArgs.join(" ")}`.nothrow();
|
||||
|
||||
await dbProcess.kill("SIGINT");
|
||||
try {
|
||||
$.env = {
|
||||
...getTestEnvVariables(),
|
||||
PATH: process.env["PATH"],
|
||||
HOME: process.env["HOME"],
|
||||
SHOULD_LOG_ERRORS: process.env["SHOULD_LOG_ERRORS"] ?? "true",
|
||||
};
|
||||
await $`bun db:migrate`.nothrow();
|
||||
await $({
|
||||
verbose: true,
|
||||
quote: (arg) => arg,
|
||||
})`FORCE_COLOR=1 bun test ${positionalArgs.join(" ")}`;
|
||||
} finally {
|
||||
await dbProcess.kill("SIGINT");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user