( bytes: Uint8Array, width = 640, height = 480, )
| 10 | import { getCacheDir } from '#/utils/paths'; |
| 11 | |
| 12 | function storeWith( |
| 13 | bytes: Uint8Array, |
| 14 | width = 640, |
| 15 | height = 480, |
| 16 | ): { store: ImageAttachmentStore; placeholder: string } { |
| 17 | const store = new ImageAttachmentStore(); |
| 18 | const att = store.addImage(bytes, 'image/png', width, height); |
| 19 | return { store, placeholder: att.placeholder }; |
| 20 | } |
| 21 | |
| 22 | /** Point `getCacheDir()` at a fresh temp home for the duration of a test. */ |
| 23 | function setupTempCache(): { cleanup: () => void } { |
no test coverage detected