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

Function get

packages/core/sdk/src/oauth-session-cleanup.test.ts:101–121  ·  view source on GitHub ↗
(target, property)

Source from the content-addressed store, hash-verified

99const withFailingDeletes = (db: FumaDb, table: string): FumaDb =>
100 new Proxy(db, {
101 get(target, property) {
102 if (property === "withContext") {
103 return (context: unknown) => withFailingDeletes(withQueryContext(target, context), table);
104 }
105 if (property === "deleteMany") {
106 return async (name: string, ...rest: readonly unknown[]) => {
107 if (name === table) {
108 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: a FumaDB query reports failure by rejecting, which is the fault being simulated
109 throw new StorageError({
110 message: `simulated storage failure deleting from "${table}"`,
111 cause: undefined,
112 });
113 }
114 const forward = Reflect.get(target, property) as (
115 ...args: readonly unknown[]
116 ) => Promise<unknown>;
117 return forward.call(target, name, ...rest);
118 };
119 }
120 return Reflect.get(target, property);
121 },
122 });
123
124describe("a dead authorization flow does not keep its PKCE verifier", () => {

Callers

nothing calls this directly

Calls 4

withQueryContextFunction · 0.90
withFailingDeletesFunction · 0.85
callMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected