From b550088384db14c424701ab9656f79f36b26d964 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 22 Apr 2025 11:39:01 -0400 Subject: [PATCH] Fixed failing test by not trying to mock rng --- test/abilities/harvest.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/abilities/harvest.test.ts b/test/abilities/harvest.test.ts index 1536b85d79b..6414bb8e15a 100644 --- a/test/abilities/harvest.test.ts +++ b/test/abilities/harvest.test.ts @@ -1,4 +1,5 @@ import { BattlerIndex } from "#app/battle"; +import { PostTurnRestoreBerryAbAttr } from "#app/data/abilities/ability"; import type Pokemon from "#app/field/pokemon"; import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier"; import type { ModifierOverride } from "#app/modifier/modifier-type"; @@ -72,14 +73,13 @@ describe("Abilities - Harvest", () => { it("tracks berries eaten while disabled/not present", async () => { // Note: this also checks for harvest not being present as neutralizing gas works by making - // the game consider all other pokemon to *not* have any ability. + // the game consider all other pokemon to *not* have their respective abilities. game.override .startingHeldItems([ { name: "BERRY", type: BerryType.ENIGMA, count: 2 }, { name: "BERRY", type: BerryType.LUM, count: 2 }, ]) - .enemyAbility(Abilities.NEUTRALIZING_GAS) - .weather(WeatherType.NONE); // clear weather so we can control when harvest rolls succeed + .enemyAbility(Abilities.NEUTRALIZING_GAS); await game.classicMode.startBattle([Species.MILOTIC]); const milotic = game.scene.getPlayerPokemon()!; @@ -100,7 +100,7 @@ describe("Abilities - Harvest", () => { await game.forceEnemyMove(Moves.NUZZLE); await game.phaseInterceptor.to("TurnEndPhase", false); - vi.spyOn(Phaser.Math.RND, "realInRange").mockReturnValue(0); + vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValue(false); await game.phaseInterceptor.to("TurnEndPhase"); expect(milotic.battleData.berriesEaten).toEqual(