test: create test runner to do initial setup for DB
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: Install
|
- name: Install
|
||||||
run: bun install
|
run: bun install
|
||||||
- name: Test
|
- name: Test
|
||||||
run: bun test
|
run: bun run test
|
||||||
# TODO: uncomment this when https://github.com/cloudflare/workers-sdk/issues/5082 is fixed
|
# TODO: uncomment this when https://github.com/cloudflare/workers-sdk/issues/5082 is fixed
|
||||||
# - name: Verify env
|
# - name: Verify env
|
||||||
# run: bun env:verify
|
# run: bun env:verify
|
||||||
|
|||||||
13
testRunner.ts
Normal file
13
testRunner.ts
Normal 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");
|
||||||
Reference in New Issue
Block a user