(blob: Blob | null)
| 36 | }; |
| 37 | |
| 38 | const paints = (blob: Blob | null) => { |
| 39 | const ctx = { scale: jest.fn(), drawImage: jest.fn() }; |
| 40 | |
| 41 | jest |
| 42 | .spyOn(HTMLCanvasElement.prototype, 'getContext') |
| 43 | .mockReturnValue(ctx as never); |
| 44 | jest |
| 45 | .spyOn(HTMLCanvasElement.prototype, 'toBlob') |
| 46 | .mockImplementation((done) => done(blob)); |
| 47 | |
| 48 | return ctx; |
| 49 | }; |
| 50 | |
| 51 | beforeEach(() => { |
| 52 | document.body.innerHTML = ''; |