[Test] Fix hyper beam and purify test rng (#3449)

This commit is contained in:
NightKev 2024-08-09 06:40:00 -07:00 committed by GitHub
parent 750d9051c4
commit fe429d0c8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,7 @@ describe("Moves - Hyper Beam", () => {
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
game.override.enemyLevel(100);
game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]); game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]);
vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100);

View File

@ -7,6 +7,8 @@ import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
import { mockTurnOrder } from "../utils/testUtils";
import { BattlerIndex } from "#app/battle.js";
const TIMEOUT = 20 * 1000; const TIMEOUT = 20 * 1000;
@ -49,6 +51,7 @@ describe("Moves - Purify", () => {
enemyPokemon.status = new Status(StatusEffect.BURN); enemyPokemon.status = new Status(StatusEffect.BURN);
game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY)); game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY));
await mockTurnOrder(game, [BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to(MoveEndPhase); await game.phaseInterceptor.to(MoveEndPhase);
expect(enemyPokemon.status).toBeNull(); expect(enemyPokemon.status).toBeNull();
@ -68,6 +71,7 @@ describe("Moves - Purify", () => {
const playerInitialHp = playerPokemon.hp; const playerInitialHp = playerPokemon.hp;
game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY)); game.doAttack(getMovePosition(game.scene, 0, Moves.PURIFY));
await mockTurnOrder(game, [BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to(MoveEndPhase); await game.phaseInterceptor.to(MoveEndPhase);
expect(playerPokemon.hp).toBe(playerInitialHp); expect(playerPokemon.hp).toBe(playerInitialHp);