(target, property)
| 99 | const 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 | |
| 124 | describe("a dead authorization flow does not keep its PKCE verifier", () => { |
nothing calls this directly
no test coverage detected