15 lines
741 B
TypeScript
15 lines
741 B
TypeScript
import { readFile } from "node:fs/promises";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("PostgreSQL account script concurrency contract", () => {
|
|
it("serializes bootstrap and legacy imports that target the same logical account", async () => {
|
|
const [bootstrap, legacyImport] = await Promise.all([
|
|
readFile(new URL("../scripts/bootstrap-admin.mjs", import.meta.url), "utf8"),
|
|
readFile(new URL("../scripts/import-legacy-accounts.mjs", import.meta.url), "utf8")
|
|
]);
|
|
expect(bootstrap).toContain("pg_advisory_xact_lock");
|
|
expect(legacyImport).toContain("pg_advisory_xact_lock(hashtextextended($1, 0))");
|
|
expect(legacyImport).toContain("session_version=platform_users.session_version+1");
|
|
});
|
|
});
|