Updated to just use DATABASE_* in everything other than local docker.
This commit is contained in:
Stefan Lazic committed 2026-08-07 17:30:12 +01:00
1 parent 769d3f9ebc
commit 51de4f4ef5
19 files changed
+120 -56

No files matched your search

+8 -7
View File
@@ -2,16 +2,17 @@ import { execFileSync } from "node:child_process";
/**
* Applies migrations and loads the dev/demo seed data against whatever
* DATABASE_URL points at before the suite runs. Deliberately does not
* create or tear down the database itself — same division of
* responsibility as `npm run test:integration`, where the caller is
* responsible for pointing DATABASE_URL at a disposable Postgres.
* DATABASE_HOST/PORT/NAME/USER/PASSWORD point at before the suite runs.
* Deliberately does not create or tear down the database itself — same
* division of responsibility as `npm run test:integration`, where the
* caller is responsible for pointing these at a disposable database.
*/
export default function globalSetup() {
if (!process.env.DATABASE_URL) {
if (!process.env.DATABASE_HOST || !process.env.DATABASE_NAME || !process.env.DATABASE_USER) {
throw new Error(
"DATABASE_URL is not set. Point it at a disposable Postgres before running the e2e suite, e.g.\n" +
' DATABASE_URL="postgresql://user:pass@localhost:5432/nextchair_e2e" npm run test:e2e',
"Database connection is not configured. Point DATABASE_HOST, DATABASE_NAME, DATABASE_USER, and " +
"DATABASE_PASSWORD at a disposable MySQL database before running the e2e suite, e.g.\n" +
' DATABASE_HOST=localhost DATABASE_NAME=nextchair_e2e DATABASE_USER=user DATABASE_PASSWORD=pass npm run test:e2e',
);
}