test: create test runner to do initial setup for DB

This commit is contained in:
2024-06-12 09:33:14 -04:00
parent 8d17462df7
commit 09ffff7c56
2 changed files with 14 additions and 1 deletions

13
testRunner.ts Normal file
View File

@@ -0,0 +1,13 @@
import { $ } from "zx";
const tursoProcess = $`turso dev --port 3000`.nothrow();
process.env.TURSO_URL = "http://127.0.0.1:3000";
process.env.TURSO_AUTH_TOKEN = "asd";
await $`bun db:migrate`.nothrow();
await $({
verbose: true,
quote: (arg) => arg,
})`FORCE_COLOR=1 bun test ${process.argv.slice(2).join(" ")}`.nothrow();
await tursoProcess.kill("SIGINT");