Patchpass V1
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { execSync } from "child_process";
|
||||
import { join } from "path";
|
||||
|
||||
/**
|
||||
* Vitest global setup — bring the test database schema up to date via Prisma
|
||||
* migrations before any test runs. Runs once for the whole suite.
|
||||
*/
|
||||
export default function setup() {
|
||||
const backendRoot = join(__dirname, "../..");
|
||||
const dbUrl =
|
||||
process.env.TEST_DATABASE_URL ||
|
||||
"postgresql://patchpass:patchpass@localhost:5433/patchpass_test";
|
||||
execSync("npx prisma migrate deploy", {
|
||||
cwd: backendRoot,
|
||||
env: { ...process.env, DATABASE_URL: dbUrl },
|
||||
stdio: "inherit",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user