From 05a3142c135d27de3a40a243fb984926fe651666 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 16:38:56 -0700 Subject: [PATCH] add OverridesHelper.startingHeldItems --- 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 d6bb0169540..00de71240b4 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -5,6 +5,7 @@ import { Moves } from "#app/enums/moves.js"; import { Species } from "#app/enums/species.js"; import * as GameMode from "#app/game-mode"; import { GameModes, getGameMode } from "#app/game-mode"; +import { ModifierOverride } from "#app/modifier/modifier-type.js"; import Overrides from "#app/overrides"; import GameManager from "#test/utils/gameManager"; import { vi } from "vitest"; @@ -52,6 +53,17 @@ export class OverridesHelper { return this; } + /** + * Override the player (pokemon) starting held items + * @param items the items to hold + * @returns this + */ + startingHeldItems(items: ModifierOverride[]) { + vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue(items); + this.log("Player Pokemon starting held items set to:", items); + return this; + } + /** * Override the player (pokemon) {@linkcode Species | species} * @param species the (pokemon) {@linkcode Species | species} to set