()
| 239 | } |
| 240 | |
| 241 | function installCanvasToBlob(): () => void { |
| 242 | const originalToBlob = Object.getOwnPropertyDescriptor(HTMLCanvasElement.prototype, 'toBlob'); |
| 243 | Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', { |
| 244 | configurable: true, |
| 245 | value: (callback: BlobCallback) => { |
| 246 | callback(new Blob(['png'], { type: 'image/png' })); |
| 247 | }, |
| 248 | }); |
| 249 | |
| 250 | return () => { |
| 251 | restoreProperty(HTMLCanvasElement.prototype, 'toBlob', originalToBlob); |
| 252 | }; |
| 253 | } |
| 254 | |
| 255 | function installCanvasContext(): () => void { |
| 256 | const originalGetContext = Object.getOwnPropertyDescriptor(HTMLCanvasElement.prototype, 'getContext'); |
no test coverage detected