diff --git a/src/testRunner.ts b/src/testRunner.ts index 87a6a12..49e3b88 100644 --- a/src/testRunner.ts +++ b/src/testRunner.ts @@ -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);