mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
test(integration): let the suite run against another Postgres major
INTEGRATION_PG_IMAGE overrides the container image, so the same suite can prove a major the compose file does not ship yet.
This commit is contained in:
1 parent
875a2a98d6
commit
41acdbfd54
1 file changed
+6
-1
@@ -44,6 +44,11 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const PROJECT_ROOT = resolve(__dirname, "..", "..");
|
||||
|
||||
// The compose file ships Postgres 16; INTEGRATION_PG_IMAGE runs the same
|
||||
// suite against another major (the TrueNAS app defaults to 18).
|
||||
const POSTGRES_IMAGE =
|
||||
process.env.INTEGRATION_PG_IMAGE?.trim() || "postgres:16-alpine";
|
||||
|
||||
let started: StartedPostgreSqlContainer | null = null;
|
||||
|
||||
declare module "vitest" {
|
||||
@@ -56,7 +61,7 @@ declare module "vitest" {
|
||||
export default async function setup(
|
||||
project: TestProject,
|
||||
): Promise<() => Promise<void>> {
|
||||
let container = new PostgreSqlContainer("postgres:16-alpine")
|
||||
let container = new PostgreSqlContainer(POSTGRES_IMAGE)
|
||||
.withDatabase(TEMPLATE_DATABASE)
|
||||
.withUsername("healthlog")
|
||||
.withPassword("healthlog")
|
||||
|
||||
Reference in new issue
Block a user