13 lines
385 B
TypeScript
13 lines
385 B
TypeScript
import "dotenv/config";
|
|
import { afterAll } from "vitest";
|
|
|
|
// Runs before each test file's imports: point the app's db module at the
|
|
// test database instead of the development one.
|
|
process.env.DATABASE_URL =
|
|
process.env.TEST_DATABASE_URL || "postgresql://blog:blog@localhost:5434/blog_test";
|
|
|
|
afterAll(async () => {
|
|
const { pool } = await import("@/db");
|
|
await pool.end();
|
|
});
|