MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / makeFakeClient

Function makeFakeClient

packages/core/sdk/src/http-auth/migrate.test.ts:32–47  ·  view source on GitHub ↗
(rows: Record<string, unknown>[])

Source from the content-addressed store, hash-verified

30
31// A tiny scripted fake standing in for a libSQL client.
32const 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
49describe("runSqliteAuthConfigMigration", () => {
50 it("rewrites legacy rows in a transaction and reports the count", async () => {

Callers 1

migrate.test.tsFile · 0.70

Calls 2

pushMethod · 0.80
resolveMethod · 0.80

Tested by

no test coverage detected