The parts of a CodeGraph the lifecycle drives, with a sync that fails as told.
(fail: (call: number) => Error | null)
| 23 | |
| 24 | /** The parts of a CodeGraph the lifecycle drives, with a sync that fails as told. */ |
| 25 | function fakeGraph(fail: (call: number) => Error | null) { |
| 26 | let calls = 0; |
| 27 | const graph = { |
| 28 | get syncCalls() { return calls; }, |
| 29 | watch: () => false, |
| 30 | isWatching: () => false, |
| 31 | isIndexing: () => false, |
| 32 | hasPendingIndexRecovery: () => false, |
| 33 | close: () => {}, |
| 34 | sync: async () => { |
| 35 | calls++; |
| 36 | const err = fail(calls); |
| 37 | if (err) throw err; |
| 38 | return { filesAdded: 0, filesModified: 0, filesRemoved: 0, durationMs: 1 }; |
| 39 | }, |
| 40 | }; |
| 41 | return graph; |
| 42 | } |
| 43 | |
| 44 | const valveAbort = () => new WalValveAbortError( |
| 45 | 'WAL checkpoint cannot progress while a reader pins frames (test).', |
no test coverage detected