From 4c15fd86b0cf6f566c3f037be038bc141a051d39 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 16:03:26 -0700 Subject: [PATCH] apply game.override.starterForms --- src/test/abilities/battle_bond.test.ts | 21 ++++++++++----------- src/test/abilities/disguise.test.ts | 4 ++-- src/test/abilities/ice_face.test.ts | 2 +- src/test/abilities/power_construct.test.ts | 17 ++++++++--------- src/test/abilities/schooling.test.ts | 17 ++++++++--------- src/test/abilities/shields_down.test.ts | 17 ++++++++--------- src/test/abilities/zen_mode.test.ts | 17 ++++++++--------- src/test/abilities/zero_to_hero.test.ts | 17 ++++++++--------- 8 files changed, 53 insertions(+), 59 deletions(-) diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 2129bcd24e4..ce41f9b6603 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -1,13 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; -import Overrides from "#app/overrides"; -import { Moves } from "#enums/moves"; -import { Abilities } from "#enums/abilities"; -import { Species } from "#enums/species"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; -import { TurnEndPhase } from "#app/phases.js"; -import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -37,10 +36,10 @@ describe("Abilities - BATTLE BOND", () => { test( "check if fainted pokemon switches to base form on arena reset", async () => { - const baseForm = 1, - ashForm = 2; + const baseForm = 1; + const ashForm = 2; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.GRENINJA]: ashForm, }); diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index cdc5852e8c7..6a2027a44d6 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -40,7 +40,7 @@ describe("Abilities - DISGUISE", () => { const baseForm = 0, bustedForm = 1; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.MIMIKYU]: bustedForm, }); @@ -75,7 +75,7 @@ describe("Abilities - DISGUISE", () => { game.override.startingLevel(20); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(20); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.MIMIKYU]: baseForm, }); diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index 65d9fe1e489..b5dec492721 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -205,7 +205,7 @@ describe("Abilities - Ice Face", () => { game.override.startingWave(4); game.override.startingLevel(4); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.EISCUE]: noiceForm, }); diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index 4128cf7b5d2..769499c0e53 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -1,13 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; -import Overrides from "#app/overrides"; -import { Moves } from "#enums/moves"; -import { Abilities } from "#enums/abilities"; -import { Species } from "#enums/species"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; -import { TurnEndPhase } from "#app/phases.js"; -import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -40,7 +39,7 @@ describe("Abilities - POWER CONSTRUCT", () => { const baseForm = 2, completeForm = 4; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.ZYGARDE]: completeForm, }); diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index 38d8cfd74f2..7671534a549 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -1,13 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; -import Overrides from "#app/overrides"; -import { Moves } from "#enums/moves"; -import { Abilities } from "#enums/abilities"; -import { Species } from "#enums/species"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; -import { TurnEndPhase } from "#app/phases.js"; -import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -40,7 +39,7 @@ describe("Abilities - SCHOOLING", () => { const soloForm = 0, schoolForm = 1; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.WISHIWASHI]: schoolForm, }); diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 1b5582d44a7..64904c80032 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -1,13 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; -import Overrides from "#app/overrides"; -import { Moves } from "#enums/moves"; -import { Abilities } from "#enums/abilities"; -import { Species } from "#enums/species"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; -import { TurnEndPhase } from "#app/phases.js"; -import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -40,7 +39,7 @@ describe("Abilities - SHIELDS DOWN", () => { const meteorForm = 0, coreForm = 7; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.MINIOR]: coreForm, }); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index dfb96c7d336..8f4c8b42af5 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -1,7 +1,6 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import Overrides from "#app/overrides"; +import { Stat } from "#app/data/pokemon-stat"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase"; import { CommandPhase, DamagePhase, @@ -14,15 +13,15 @@ import { TurnInitPhase, TurnStartPhase, } from "#app/phases"; -import { Mode } from "#app/ui/ui"; -import { Stat } from "#app/data/pokemon-stat"; +import GameManager from "#app/test/utils/gameManager"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; -import { QuietFormChangePhase } from "#app/form-change-phase"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -154,7 +153,7 @@ describe("Abilities - ZEN MODE", () => { const baseForm = 0, zenForm = 1; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.DARMANITAN]: zenForm, }); diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index 29e07078dfc..409fb35a78c 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -1,13 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { TurnEndPhase } from "#app/phases.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; -import Overrides from "#app/overrides"; -import { Moves } from "#enums/moves"; -import { Abilities } from "#enums/abilities"; -import { Species } from "#enums/species"; -import { Status, StatusEffect } from "#app/data/status-effect.js"; -import { TurnEndPhase } from "#app/phases.js"; -import { QuietFormChangePhase } from "#app/form-change-phase.js"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; @@ -40,7 +39,7 @@ describe("Abilities - ZERO TO HERO", () => { const baseForm = 0, heroForm = 1; game.override.startingWave(4); - vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ + game.override.starterForms({ [Species.PALAFIN]: heroForm, });