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

Function recordingAdmin

packages/core/api/src/admin/admin-users.test.ts:1202–1223  ·  view source on GitHub ↗
(calls: string[])

Source from the content-addressed store, hash-verified

1200/** An `ExecutorAdmin` that answers everything and records the reads it was
1201 * asked for, so a test can assert the call the filter chose. */
1202const recordingAdmin = (calls: string[]): ExecutorAdmin => ({
1203 listSubjects: (options) => {
1204 calls.push(`listSubjects:${options?.externalIds?.join(",") ?? "*"}`);
1205 return Effect.succeed([A_SUBJECT]);
1206 },
1207 getSubject: () => {
1208 calls.push("getSubject");
1209 return Effect.succeed(A_SUBJECT);
1210 },
1211 listSubjectConnections: () => {
1212 calls.push("listSubjectConnections");
1213 return Effect.succeed([]);
1214 },
1215 listSubjectsWithConnections: (options) => {
1216 calls.push(`listSubjectsWithConnections:${options?.externalIds?.join(",") ?? "*"}`);
1217 return Effect.succeed([{ ...A_SUBJECT, connections: [] }]);
1218 },
1219 getSubjectWithConnections: () => {
1220 calls.push("getSubjectWithConnections");
1221 return Effect.succeed({ ...A_SUBJECT, connections: [] });
1222 },
1223});
1224
1225describe("admin users reads — the ?email= filter is applied before the read", () => {
1226 it.effect("resolves the joined view through the keyed read, never a page scan", () =>

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected