From bb1e3f7d209a0c67a6a3134a41756cc0675a93ba Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 15:36:06 -0700 Subject: [PATCH] add OverridesHelper.moveset() --- 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 a888e257c44..5767cac4914 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -74,6 +74,18 @@ export class OverridesHelper { return this; } + /** + * Override the player (pokemon) {@linkcode Moves | moves}set + * @param moveset the {@linkcode Moves | moves}set to set + * @returns this + */ + moveset(moveset: Moves[]): this { + vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(moveset); + const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", "); + this.log(`Player Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`); + return this; + } + /** * Override each wave to have or not have standard trainer battles * @returns this