From 286e1802155faf0b1e6d02707af32fa3e9916e2b Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:17:51 +0200 Subject: [PATCH] test: use vi.spyOn to mock console.debug --- tests/ImpassableTerrain.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ImpassableTerrain.test.ts b/tests/ImpassableTerrain.test.ts index f0bc49b1f..b9bb350f2 100644 --- a/tests/ImpassableTerrain.test.ts +++ b/tests/ImpassableTerrain.test.ts @@ -63,7 +63,7 @@ function buildTerrain( } async function setupImpassableGame(humans: PlayerInfo[] = []): Promise { - console.debug = () => {}; + vi.spyOn(console, "debug").mockImplementation(() => {}); const full = buildTerrain(MAP_W, MAP_H, WALL_X, WALL_WIDTH); const mini = buildTerrain(MINI_W, MINI_H, Math.floor(WALL_X / 2), 1); @@ -104,6 +104,10 @@ describe("Impassable Terrain", () => { let player: Player; let other: Player; + afterEach(() => { + vi.restoreAllMocks(); + }); + beforeEach(async () => { game = await setupImpassableGame([ new PlayerInfo("player", PlayerType.Human, "c1", "player_id"),