From 7732411c92ee4af5c9fb1746c63f2091e8728b70 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 15:31:16 -0700 Subject: [PATCH] add OverridesHelper.ability() --- src/test/utils/overridesHelper.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/utils/overridesHelper.ts b/src/test/utils/overridesHelper.ts index bcb550945a6..a888e257c44 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -63,6 +63,17 @@ export class OverridesHelper { return this; } + /** + * Override the player (pokemon) {@linkcode Abilities | ability} + * @param ability the (pokemon) {@linkcode Abilities | ability} to set + * @returns this + */ + ability(ability: Abilities): this { + vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); + this.log(`Player Pokemon ability set to ${Abilities[ability]} (=${ability})!`); + return this; + } + /** * Override each wave to have or not have standard trainer battles * @returns this