Run tests against a throwaway MariaDB Docker container

- Add scripts/test.ts: starts a temporary MariaDB container on a random
  localhost port, waits for TCP readiness, runs all test files, and
  always removes the container (including on Ctrl+C)
- `bun run test` uses the script; `bun run test:unit` runs without a DB
- BUN_MARIADB_TEST_IMAGE selects the image; an existing
  BUN_MARIADB_TEST_DB skips Docker
- Document in README

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 02:55:32 +01:00
co-authored by Claude Opus 5.5
parent ddf431e866
commit 1b8e591787
3 changed files with 166 additions and 5 deletions
+2 -1
View File
@@ -29,7 +29,8 @@
"dev": "tsc --watch",
"compile": "rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json && chmod +x dist/commands/index.js",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "bun test tests",
"test": "bun run scripts/test.ts",
"test:unit": "bun test",
"prepublishOnly": "bun run compile"
},
"devDependencies": {