From fe429d0c8ca6e42250ec5513a85f46b1d1a0b176 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 9 Aug 2024 06:40:00 -0700 Subject: [PATCH] [Test] Fix hyper beam and purify test rng (#3449) --- src/test/moves/hyper_beam.test.ts | 1 + src/test/moves/purify.test.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/test/moves/hyper_beam.test.ts b/src/test/moves/hyper_beam.test.ts index 369d4cac853..f33ce4f5478 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -33,6 +33,7 @@ describe("Moves - Hyper Beam", () => { game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyLevel(100); game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]); vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100); diff --git a/src/test/moves/purify.test.ts b/src/test/moves/purify.test.ts index 0367cc5a9b2..69d20ca0cc0 100644 --- a/src/test/moves/purify.test.ts +++ b/src/test/moves/purify.test.ts @@ -7,6 +7,8 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; +import { mockTurnOrder } from "../utils/testUtils"; +import { BattlerIndex } from "#app/battle.js"; const TIMEOUT = 20 * 1000; @@ -49,6 +51,7 @@ describe("Moves - Purify", () => { enemyPokemon.status = new Status(StatusEffect.BURN); game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY)); + await mockTurnOrder(game, [BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEndPhase); expect(enemyPokemon.status).toBeNull(); @@ -68,6 +71,7 @@ describe("Moves - Purify", () => { const playerInitialHp = playerPokemon.hp; game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY)); + await mockTurnOrder(game, [BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEndPhase); expect(playerPokemon.hp).toBe(playerInitialHp);