MCPcopy Create free account
hub / github.com/dailydotdev/apps / paints

Function paints

packages/shared/src/features/interests/nodeToPng.spec.ts:38–49  ·  view source on GitHub ↗
(blob: Blob | null)

Source from the content-addressed store, hash-verified

36};
37
38const 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
51beforeEach(() => {
52 document.body.innerHTML = '';

Callers 1

nodeToPng.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected