mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 02:32:21 +02:00
Apply suggestions from code review
This commit is contained in:
parent
031ea40fa8
commit
610b82c4c0
@ -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) {
|
||||
|
@ -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: () => {},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user