()
| 253 | } |
| 254 | |
| 255 | function installCanvasContext(): () => void { |
| 256 | const originalGetContext = Object.getOwnPropertyDescriptor(HTMLCanvasElement.prototype, 'getContext'); |
| 257 | Object.defineProperty(HTMLCanvasElement.prototype, 'getContext', { |
| 258 | configurable: true, |
| 259 | value: vi.fn(() => ({ |
| 260 | drawImage: vi.fn(), |
| 261 | })), |
| 262 | }); |
| 263 | |
| 264 | return () => { |
| 265 | restoreProperty(HTMLCanvasElement.prototype, 'getContext', originalGetContext); |
| 266 | }; |
| 267 | } |
| 268 | |
| 269 | function installObjectUrls(): () => void { |
| 270 | const originalCreateObjectUrl = Object.getOwnPropertyDescriptor(URL, 'createObjectURL'); |
no test coverage detected