diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index c29787705fb..a99415d6954 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -27,7 +27,7 @@ describe("Abilities - Hustle", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HUSTLE); + game.override.ability(Abilities.HUSTLE); game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5); vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); diff --git a/src/test/items/leftovers.test.ts b/src/test/items/leftovers.test.ts index 7c89e1e299d..aff1596ad9e 100644 --- a/src/test/items/leftovers.test.ts +++ b/src/test/items/leftovers.test.ts @@ -27,7 +27,7 @@ describe("Items - Leftovers", () => { game = new GameManager(phaserGame); game.override.battleType("single"); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); + game.override.ability(Abilities.UNNERVE); game.override.moveset([Moves.SPLASH]); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.UNNERVE); diff --git a/src/test/moves/hyper_beam.test.ts b/src/test/moves/hyper_beam.test.ts index 4cd9d0600a8..623b24dbb3c 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -1,14 +1,13 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { Abilities } from "#app/enums/abilities.js"; -import { Species } from "#app/enums/species.js"; -import { Moves } from "#app/enums/moves.js"; import { allMoves } from "#app/data/move.js"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { BerryPhase, TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#app/enums/abilities.js"; import { BattlerTagType } from "#app/enums/battler-tag-type.js"; +import { Moves } from "#app/enums/moves.js"; +import { Species } from "#app/enums/species.js"; +import { BerryPhase, TurnEndPhase } from "#app/phases.js"; +import GameManager from "#app/test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { getMovePosition } from "../utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; // 20 sec timeout for all tests @@ -30,7 +29,7 @@ describe("Moves - Hyper Beam", () => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index 0d637f05355..0fc01821838 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -1,16 +1,15 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; -import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { MovePhase, TurnInitPhase } from "#app/phases"; import { BattleStat } from "#app/data/battle-stat"; +import { StockpilingTag } from "#app/data/battler-tags.js"; +import { allMoves } from "#app/data/move.js"; +import { BattlerTagType } from "#app/enums/battler-tag-type.js"; +import { MoveResult, TurnMove } from "#app/field/pokemon.js"; +import { MovePhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#app/test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { StockpilingTag } from "#app/data/battler-tags.js"; -import { MoveResult, TurnMove } from "#app/field/pokemon.js"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { allMoves } from "#app/data/move.js"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Spit Up", () => { @@ -36,7 +35,7 @@ describe("Moves - Spit Up", () => { game.override.enemyLevel(2000); game.override.moveset([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); }); describe("consumes all stockpile stacks to deal damage (scaling with stacks)", () => { diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index 30e2bb9d642..9157cf247be 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -36,7 +36,7 @@ describe("Moves - Stockpile", () => { vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); game.override.moveset([Moves.STOCKPILE, Moves.SPLASH]); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); }); it("Gains a stockpile stack and increases DEF and SPDEF by 1 on each use, fails at max stacks (3)", { timeout: 10000 }, async () => { diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 28f6b73ee7d..7c3d3ae1613 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -1,15 +1,14 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; -import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { MovePhase, TurnInitPhase } from "#app/phases"; import { BattleStat } from "#app/data/battle-stat"; +import { StockpilingTag } from "#app/data/battler-tags.js"; +import { BattlerTagType } from "#app/enums/battler-tag-type.js"; +import { MoveResult, TurnMove } from "#app/field/pokemon.js"; +import { MovePhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#app/test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { StockpilingTag } from "#app/data/battler-tags.js"; -import { MoveResult, TurnMove } from "#app/field/pokemon.js"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Swallow", () => { @@ -35,7 +34,7 @@ describe("Moves - Swallow", () => { game.override.enemyLevel(2000); game.override.moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]); - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); }); describe("consumes all stockpile stacks to heal (scaling with stacks)", () => {