From 08e0531eae020f74ba42c7d57324a908759c3089 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 14:53:34 -0700 Subject: [PATCH] add OverridesHelper.enemySpecies() --- src/test/utils/overridesHelper.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/utils/overridesHelper.ts b/src/test/utils/overridesHelper.ts index 4fe605b4cac..5d9472deb70 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -1,5 +1,6 @@ import { Weather, WeatherType } from "#app/data/weather"; import { Biome } from "#app/enums/biome"; +import { Species } from "#app/enums/species.js"; import * as GameMode from "#app/game-mode"; import { GameModes, getGameMode } from "#app/game-mode"; import Overrides from "#app/overrides"; @@ -92,6 +93,17 @@ export class OverridesHelper { return this; } + /** + * Override the enemy (pokemon) species + * @param species the (pokemon) species to set + * @returns this + */ + enemySpecies(species: Species): this { + vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(species); + this.log(`Enemy Pokemon species set to ${Species[species]} (=${species})!`); + return this; + } + private log(...params: any[]) { console.log("Overrides:", ...params); }