From 9ee4c4871279ab276418b2f0768ea9a6647703eb Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Fri, 30 May 2025 13:02:25 -0400 Subject: [PATCH] Updated test comment and fixed code --- test/battle/battle.test.ts | 13 +++++-------- test/reload.test.ts | 2 +- test/testUtils/helpers/classicModeHelper.ts | 2 ++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/test/battle/battle.test.ts b/test/battle/battle.test.ts index 26424b07bde..b0c3c70fbd9 100644 --- a/test/battle/battle.test.ts +++ b/test/battle/battle.test.ts @@ -1,7 +1,6 @@ import { allSpecies } from "#app/data/pokemon-species"; import { Stat } from "#enums/stat"; import { GameModes, getGameMode } from "#app/game-mode"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; import { CommandPhase } from "#app/phases/command-phase"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { EncounterPhase } from "#app/phases/encounter-phase"; @@ -12,7 +11,6 @@ import { SelectGenderPhase } from "#app/phases/select-gender-phase"; import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; import { SelectStarterPhase } from "#app/phases/select-starter-phase"; import { SummonPhase } from "#app/phases/summon-phase"; -import { SwitchPhase } from "#app/phases/switch-phase"; import { TitlePhase } from "#app/phases/title-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; import GameManager from "#test/testUtils/gameManager"; @@ -283,21 +281,20 @@ describe("Test - Battle Phase", () => { }); it("does not force switch if active pokemon faints at same time as enemy mon and is revived in post-battle", async () => { - const moveToUse = Moves.TAKE_DOWN; game.override .battleStyle("single") .enemySpecies(Species.RATTATA) .startingWave(1) .startingLevel(100) - .moveset([moveToUse]) + .moveset([Moves.TAKE_DOWN]) .enemyMoveset(Moves.SPLASH) .startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]); - await game.classicMode.startBattle([Species.SAWK]); + await game.classicMode.startBattle([Species.SAWK, Species.SAWK]); game.scene.getPlayerPokemon()!.hp = 1; - game.move.select(moveToUse); + game.move.select(Moves.TAKE_DOWN); - await game.phaseInterceptor.to(BattleEndPhase); + await game.phaseInterceptor.to("BattleEndPhase"); game.doRevivePokemon(0); // pretend max revive was picked game.doSelectModifier(); @@ -309,6 +306,6 @@ describe("Test - Battle Phase", () => { }, () => game.isCurrentPhase(NextEncounterPhase), ); - await game.phaseInterceptor.to(SwitchPhase); + await game.phaseInterceptor.to("SwitchPhase"); }); }); diff --git a/test/reload.test.ts b/test/reload.test.ts index 47a61f129f0..f6c1f06fd1d 100644 --- a/test/reload.test.ts +++ b/test/reload.test.ts @@ -51,7 +51,7 @@ describe("Reload", () => { .battleStyle("single") .startingLevel(100) // Avoid levelling up .disableTrainerWaves() - .moveset([Moves.SPLASH]) + .moveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH); await game.dailyMode.startBattle(); diff --git a/test/testUtils/helpers/classicModeHelper.ts b/test/testUtils/helpers/classicModeHelper.ts index 8e1ac95c733..5f78cc271c5 100644 --- a/test/testUtils/helpers/classicModeHelper.ts +++ b/test/testUtils/helpers/classicModeHelper.ts @@ -43,6 +43,8 @@ export class ClassicModeHelper extends GameManagerHelper { /** * Transitions to the start of a battle. * @param species - Optional array of species to start the battle with. + * If omitted, will select 3 daily run starters with a fixed seed of "test" + * (see `generateDailyRunStarters` in `daily-run.ts` for more info). * @returns A promise that resolves when the battle is started. */ async startBattle(species?: Species[]): Promise {