From a2c6a625987f1dfd2c2ccd2fbb1aa0b81a917182 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 22 Apr 2025 11:41:27 -0400 Subject: [PATCH] Fixed test --- test/abilities/harvest.test.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/abilities/harvest.test.ts b/test/abilities/harvest.test.ts index 6414bb8e15a..23c0ed9088c 100644 --- a/test/abilities/harvest.test.ts +++ b/test/abilities/harvest.test.ts @@ -95,13 +95,12 @@ describe("Abilities - Harvest", () => { // Give ourselves harvest and disable enemy neut gas, // but force our roll to fail so we don't accidentally recover anything + vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValueOnce(false); game.override.ability(Abilities.HARVEST); game.move.select(Moves.GASTRO_ACID); await game.forceEnemyMove(Moves.NUZZLE); - await game.phaseInterceptor.to("TurnEndPhase", false); - vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValue(false); - await game.phaseInterceptor.to("TurnEndPhase"); + await game.toNextTurn(); expect(milotic.battleData.berriesEaten).toEqual( expect.arrayContaining([BerryType.ENIGMA, BerryType.LUM, BerryType.ENIGMA, BerryType.LUM]), @@ -111,11 +110,9 @@ describe("Abilities - Harvest", () => { // proc a high roll and we _should_ get a berry back! game.move.select(Moves.SPLASH); await game.forceEnemyMove(Moves.SPLASH); - await game.phaseInterceptor.to("TurnEndPhase", false); - vi.spyOn(Phaser.Math.RND, "realInRange").mockReturnValue(1); await game.toNextTurn(); - expect(milotic?.battleData.berriesEaten).toHaveLength(3); + expect(milotic.battleData.berriesEaten).toHaveLength(3); expect(getPlayerBerries()).toHaveLength(1); });