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.
|
* 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.
|
* 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.
|
* 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.
|
* 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() {
|
export function manageListeners() {
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
|
@ -5,11 +5,15 @@ import { mockCanvas } from "#test/utils/mocks/mockCanvas";
|
|||||||
*/
|
*/
|
||||||
export const mockContext: any = {
|
export const mockContext: any = {
|
||||||
font: "",
|
font: "",
|
||||||
//@ts-ignore
|
measureText: () => {
|
||||||
measureText: () => new TextMetrics(""),
|
return {};
|
||||||
|
},
|
||||||
save: () => {},
|
save: () => {},
|
||||||
scale: () => {},
|
scale: () => {},
|
||||||
clearRect: () => {},
|
clearRect: () => {},
|
||||||
|
fillRect: () => {},
|
||||||
|
fillText: () => {},
|
||||||
|
getImageData: () => {},
|
||||||
canvas: mockCanvas,
|
canvas: mockCanvas,
|
||||||
restore: () => {},
|
restore: () => {},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user