(rows: Record<string, unknown>[])
| 30 | |
| 31 | // A tiny scripted fake standing in for a libSQL client. |
| 32 | const makeFakeClient = (rows: Record<string, unknown>[]) => { |
| 33 | const log: unknown[] = []; |
| 34 | const client: SqliteAuthConfigClient = { |
| 35 | execute: (stmt) => { |
| 36 | log.push(stmt); |
| 37 | if (typeof stmt === "string" && stmt.includes("sqlite_master")) { |
| 38 | return Promise.resolve({ rows: [{ name: "integration" }] }); |
| 39 | } |
| 40 | if (typeof stmt === "string" && stmt.startsWith("SELECT row_id")) { |
| 41 | return Promise.resolve({ rows }); |
| 42 | } |
| 43 | return Promise.resolve({ rows: [] }); |
| 44 | }, |
| 45 | }; |
| 46 | return { client, log }; |
| 47 | }; |
| 48 | |
| 49 | describe("runSqliteAuthConfigMigration", () => { |
| 50 | it("rewrites legacy rows in a transaction and reports the count", async () => { |
no test coverage detected