test: npm test starts a throwaway Postgres when TEST_DATABASE_URL is unset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfmHGGiYUjNcvJoyzdf
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 11:56:11 +08:00
1 parent f78bd635a2
commit 20e07e9d80
4 files changed
+19 -3

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
// Needs a Postgres to test against: TEST_DATABASE_URL=postgres://user:pass@host:port/db npm test
// Run with `npm test` (starts a throwaway Postgres), or set TEST_DATABASE_URL=postgres://user:pass@host:port/db
// Each run creates its own schema and drops it afterwards, so existing tables are never touched.
const { test, before, after } = require('node:test');
const assert = require('node:assert');