mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
test(integration): expect the worker's own database in the environment check
The environment check pinned the database a worker talks to as the single shared one. Each worker now runs against its own clone, so the check names the clone and asserts it is not the migrated template the clones copy.
This commit is contained in:
1 parent
d010ed2301
commit
d539eee90b
1 file changed
+5
-1
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getPrismaClient } from "./setup";
|
||||
import { TEMPLATE_DATABASE, workerDatabaseName } from "./worker-database";
|
||||
|
||||
const TEST_ENCRYPTION_KEY =
|
||||
"0000000000000000000000000000000000000000000000000000000000000000";
|
||||
@@ -22,6 +23,9 @@ describe("integration worker environment", () => {
|
||||
>`
|
||||
SELECT current_database() AS database_name
|
||||
`;
|
||||
expect(rows).toEqual([{ database_name: "healthlog_test" }]);
|
||||
// Each worker runs against its own clone, never the migrated template
|
||||
// the clones are copied from.
|
||||
expect(rows).toEqual([{ database_name: workerDatabaseName() }]);
|
||||
expect(rows[0].database_name).not.toBe(TEMPLATE_DATABASE);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user