()
| 33 | }; |
| 34 | |
| 35 | const makeFakeR2 = (): { |
| 36 | readonly bucket: R2Bucket; |
| 37 | readonly objects: Map<string, string>; |
| 38 | } => { |
| 39 | const objects = new Map<string, string>(); |
| 40 | // oxlint-disable-next-line executor/no-double-cast -- test double: only the R2 methods used by the migration are implemented |
| 41 | const bucket = { |
| 42 | get: async (key: string) => { |
| 43 | const value = objects.get(key); |
| 44 | return value === undefined ? null : { text: async () => value }; |
| 45 | }, |
| 46 | put: async (key: string, value: string) => { |
| 47 | objects.set(key, value); |
| 48 | }, |
| 49 | head: async (key: string) => (objects.has(key) ? {} : null), |
| 50 | } as unknown as R2Bucket; |
| 51 | return { bucket, objects }; |
| 52 | }; |
| 53 | |
| 54 | const insertIntegration = ( |
| 55 | client: SqliteDataMigrationClient, |
no test coverage detected