Fix duplicate import in app-caller.ts and mock Pool typing in store.test.ts
This commit is contained in:
parent
1b0546bd4c
commit
3e90a7287a
2 changed files with 7 additions and 11 deletions
|
|
@ -16,10 +16,6 @@ import { timingSafeEqual } from "node:crypto";
|
|||
import { type AppSlug } from "./contracts.js";
|
||||
import { type HeimdallConfig } from "./config.js";
|
||||
|
||||
import { timingSafeEqual } from "node:crypto";
|
||||
import { type AppSlug } from "./contracts.js";
|
||||
import { type HeimdallConfig } from "./config.js";
|
||||
|
||||
declare const appCallerBrand: unique symbol;
|
||||
|
||||
export interface AppCaller {
|
||||
|
|
|
|||
|
|
@ -464,11 +464,11 @@ describe("PostgresStore.checkSchema", () => {
|
|||
const store = new PostgresStore({
|
||||
query: async (sql: string, params?: unknown[]) => {
|
||||
queries.push({ sql, params });
|
||||
return { rows: [], rowCount: 0 } as never;
|
||||
return { rows: [], rowCount: 0 };
|
||||
},
|
||||
end: async () => {},
|
||||
connect: async () => ({}) as never,
|
||||
});
|
||||
connect: async () => ({}),
|
||||
} as unknown as Pool);
|
||||
|
||||
await expect(store.checkSchema()).resolves.toBeUndefined();
|
||||
expect(queries).toHaveLength(2);
|
||||
|
|
@ -480,12 +480,12 @@ describe("PostgresStore.checkSchema", () => {
|
|||
it("throws SCHEMA_MISSING when any core table is missing", async () => {
|
||||
const store = new PostgresStore({
|
||||
query: async (sql: string) => {
|
||||
if (sql === "SELECT 1") return { rows: [], rowCount: 0 } as never;
|
||||
return { rows: [{ name: "consent_receipts" }], rowCount: 1 } as never;
|
||||
if (sql === "SELECT 1") return { rows: [], rowCount: 0 };
|
||||
return { rows: [{ name: "consent_receipts" }], rowCount: 1 };
|
||||
},
|
||||
end: async () => {},
|
||||
connect: async () => ({}) as never,
|
||||
});
|
||||
connect: async () => ({}),
|
||||
} as unknown as Pool);
|
||||
|
||||
await expect(store.checkSchema()).rejects.toMatchObject({ code: "SCHEMA_MISSING" });
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue