diff --git a/test/utils/listenersManager.ts b/test/utils/listenersManager.ts index f5572349c0d..9252ef45a9f 100644 --- a/test/utils/listenersManager.ts +++ b/test/utils/listenersManager.ts @@ -9,13 +9,13 @@ let firstTime = true; * The list of listeners that were present during the first time this manager is run. * These initial listeners are needed throughout the entire test suite, so we never remove them. */ -const initialListeners: unknown[] = []; +const initialListeners: NodeJS.MessageListener[] = []; /** * The current listener that is only needed for the current test file. * We plan to delete it during the next test file, when it is no longer needed. */ -let currentListener; +let currentListener: NodeJS.MessageListener | null; export function manageListeners() { if (firstTime) { diff --git a/test/utils/mocks/mockContext.ts b/test/utils/mocks/mockContext.ts index 04abfbe8089..73a77312132 100644 --- a/test/utils/mocks/mockContext.ts +++ b/test/utils/mocks/mockContext.ts @@ -5,11 +5,15 @@ import { mockCanvas } from "#test/utils/mocks/mockCanvas"; */ export const mockContext: any = { font: "", - //@ts-ignore - measureText: () => new TextMetrics(""), + measureText: () => { + return {}; + }, save: () => {}, scale: () => {}, clearRect: () => {}, + fillRect: () => {}, + fillText: () => {}, + getImageData: () => {}, canvas: mockCanvas, restore: () => {}, };