diff --git a/src/test/abilities/ability_timing.test.ts b/src/test/abilities/ability_timing.test.ts index 0004479ed8c..bb025d7fc53 100644 --- a/src/test/abilities/ability_timing.test.ts +++ b/src/test/abilities/ability_timing.test.ts @@ -1,13 +1,13 @@ import { CommandPhase, MessagePhase, TurnInitPhase } from "#app/phases"; import i18next, { initI18n } from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Ability Timing", () => { diff --git a/src/test/abilities/aura_break.test.ts b/src/test/abilities/aura_break.test.ts index 918905fc00a..a34475cb1ad 100644 --- a/src/test/abilities/aura_break.test.ts +++ b/src/test/abilities/aura_break.test.ts @@ -1,13 +1,13 @@ import { allMoves } from "#app/data/move.js"; import { MoveEffectPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Aura Break", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/battery.test.ts b/src/test/abilities/battery.test.ts index 9c3248f39c0..2345e63d987 100644 --- a/src/test/abilities/battery.test.ts +++ b/src/test/abilities/battery.test.ts @@ -1,13 +1,13 @@ import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Battery", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/costar.test.ts b/src/test/abilities/costar.test.ts index 1d58d899565..ef3fb3a2ab0 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -5,9 +5,9 @@ import { Species } from "#app/enums/species.js"; import { CommandPhase, MessagePhase } from "#app/phases.js"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -42,8 +42,6 @@ describe("Abilities - COSTAR", () => { await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); let [leftPokemon, rightPokemon] = game.scene.getPlayerField(); - expect(leftPokemon).toBeDefined(); - expect(rightPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.NASTY_PLOT)); await game.phaseInterceptor.to(CommandPhase); @@ -73,8 +71,6 @@ describe("Abilities - COSTAR", () => { await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); let [leftPokemon, rightPokemon] = game.scene.getPlayerField(); - expect(leftPokemon).toBeDefined(); - expect(rightPokemon).toBeDefined(); expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); diff --git a/src/test/abilities/dry_skin.test.ts b/src/test/abilities/dry_skin.test.ts index 5434974c583..6da5ad08571 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -1,12 +1,12 @@ import { Species } from "#app/enums/species.js"; import { TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Dry Skin", () => { let phaserGame: Phaser.Game; @@ -83,7 +83,6 @@ describe("Abilities - Dry Skin", () => { await game.startBattle(); const enemy = game.scene.getEnemyPokemon(); - expect(enemy).toBeDefined(); const initialHP = 1000; enemy.hp = initialHP; diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index 6d78846071d..63e54dfb157 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -2,13 +2,13 @@ import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { Stat } from "#app/enums/stat.js"; import { DamagePhase, MoveEffectPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Hustle", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index ed04aa8bac2..a08a6a01b60 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -1,12 +1,7 @@ import { QuietFormChangePhase } from "#app/form-change-phase"; -import { - MoveEffectPhase, - MoveEndPhase, - TurnEndPhase, - TurnInitPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase, MoveEndPhase, TurnEndPhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 959f53b2022..2c2b68bc5df 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -1,10 +1,9 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import Overrides from "#app/overrides"; +import GameManager from "#test/utils/gameManager"; import { Mode } from "#app/ui/ui"; import { BattleStat } from "#app/data/battle-stat"; -import { generateStarter, getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { generateStarter, getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Status, StatusEffect } from "#app/data/status-effect"; import { GameModes, getGameMode } from "#app/game-mode"; @@ -12,6 +11,7 @@ import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectSta import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Intimidate", () => { let phaserGame: Phaser.Game; @@ -35,7 +35,7 @@ describe("Abilities - Intimidate", () => { game.override.enemyPassiveAbility(Abilities.HYDRATION); game.override.ability(Abilities.INTIMIDATE); game.override.startingWave(3); - game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); + game.override.enemyMoveset(SPLASH_ONLY); }); it("single - wild with switch", async () => { @@ -294,7 +294,7 @@ describe("Abilities - Intimidate", () => { it("single - trainer should only trigger once whatever turn we are", async () => { game.override.moveset([Moves.SPLASH]); - game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.startingWave(5); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; @@ -334,7 +334,6 @@ describe("Abilities - Intimidate", () => { it("double - wild vs only 1 on player side", async () => { game.override.battleType("double"); game.override.startingWave(3); - vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "COIN_CASE" }]); await game.runToSummon([Species.MIGHTYENA]); await game.phaseInterceptor.to(CommandPhase, false); const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index 5292bcd7c82..bc83c9bb44b 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -1,8 +1,6 @@ import { BattleStat } from "#app/data/battle-stat"; -import { - CommandPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import { CommandPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index 58e67a6ebe6..c38ec082169 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -10,9 +10,9 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/magic_guard.test.ts b/src/test/abilities/magic_guard.test.ts index 60a3cda3b08..18e28284f72 100644 --- a/src/test/abilities/magic_guard.test.ts +++ b/src/test/abilities/magic_guard.test.ts @@ -1,17 +1,17 @@ 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 GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; import { TurnEndPhase, MoveEffectPhase } from "#app/phases"; import { Moves } from "#enums/moves"; import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { WeatherType } from "#app/data/weather.js"; import { StatusEffect, getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; // 20 sec timeout @@ -33,16 +33,15 @@ describe("Abilities - Magic Guard", () => { game = new GameManager(phaserGame); /** Player Pokemon overrides */ - vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD); - vi.spyOn(overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); + game.override.ability(Abilities.MAGIC_GUARD); + game.override.moveset([Moves.SPLASH]); + game.override.startingLevel(100); /** Enemy Pokemon overrides */ - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); + game.override.enemySpecies(Species.SNORLAX); + game.override.enemyAbility(Abilities.INSOMNIA); + game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyLevel(100); }); //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Magic_Guard_(Ability) @@ -50,15 +49,13 @@ describe("Abilities - Magic Guard", () => { it( "ability should prevent damage caused by weather", async () => { - vi.spyOn(overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(WeatherType.SANDSTORM); + game.override.weather(WeatherType.SANDSTORM); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -78,15 +75,11 @@ describe("Abilities - Magic Guard", () => { "ability should prevent damage caused by status effects but other non-damage effects still apply", async () => { //Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns - vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.POISON); + game.override.statusEffect(StatusEffect.POISON); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -105,16 +98,12 @@ describe("Abilities - Magic Guard", () => { it( "ability effect should not persist when the ability is replaced", async () => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED]); - vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.POISON); + game.override.enemyMoveset([Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED]); + game.override.statusEffect(StatusEffect.POISON); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -131,18 +120,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied", async () => { - vi.spyOn(overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.BURN); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD); + game.override.enemyStatusEffect(StatusEffect.BURN); + game.override.enemyAbility(Abilities.MAGIC_GUARD); await game.startBattle([Species.MAGIKARP]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect (leadPokemon).toBeDefined(); - game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); await game.phaseInterceptor.to(TurnEndPhase); @@ -159,18 +144,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied", async () => { - vi.spyOn(overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.TOXIC); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD); + game.override.enemyStatusEffect(StatusEffect.TOXIC); + game.override.enemyAbility(Abilities.MAGIC_GUARD); await game.startBattle([Species.MAGIKARP]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect (leadPokemon).toBeDefined(); - game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); const toxicStartCounter = enemyPokemon.status.turnCount; //should be 0 @@ -197,12 +178,10 @@ describe("Abilities - Magic Guard", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); await game.phaseInterceptor.to(TurnEndPhase); @@ -225,12 +204,10 @@ describe("Abilities - Magic Guard", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); await game.phaseInterceptor.to(TurnEndPhase); @@ -250,16 +227,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents against damage from volatile status effects", async () => { await game.startBattle([Species.DUSKULL]); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD); + game.override.moveset([Moves.CURSE]); + game.override.enemyAbility(Abilities.MAGIC_GUARD); const leadPokemon = game.scene.getPlayerPokemon(); - expect (leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.CURSE)); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); await game.phaseInterceptor.to(TurnEndPhase); @@ -276,11 +251,10 @@ describe("Abilities - Magic Guard", () => { ); it("Magic Guard prevents crash damage", async () => { - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HIGH_JUMP_KICK]); + game.override.moveset([Moves.HIGH_JUMP_KICK]); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.HIGH_JUMP_KICK)); await game.phaseInterceptor.to(MoveEffectPhase, false); @@ -297,11 +271,10 @@ describe("Abilities - Magic Guard", () => { ); it("Magic Guard prevents damage from recoil", async () => { - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAKE_DOWN]); + game.override.moveset([Moves.TAKE_DOWN]); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.TAKE_DOWN)); @@ -316,11 +289,10 @@ describe("Abilities - Magic Guard", () => { ); it("Magic Guard does not prevent damage from Struggle's recoil", async () => { - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]); + game.override.moveset([Moves.STRUGGLE]); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.STRUGGLE)); @@ -336,11 +308,10 @@ describe("Abilities - Magic Guard", () => { //This tests different move attributes than the recoil tests above it("Magic Guard prevents self-damage from attacking moves", async () => { - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STEEL_BEAM]); + game.override.moveset([Moves.STEEL_BEAM]); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.STEEL_BEAM)); @@ -365,11 +336,10 @@ describe("Abilities - Magic Guard", () => { */ it("Magic Guard does not prevent self-damage from non-attacking moves", async () => { - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BELLY_DRUM]); + game.override.moveset([Moves.BELLY_DRUM]); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.BELLY_DRUM)); @@ -385,15 +355,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage from abilities with PostTurnHurtIfSleepingAbAttr", async() => { //Tests the ability Bad Dreams - vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.SLEEP); + game.override.statusEffect(StatusEffect.SLEEP); //enemy pokemon is given Spore just in case player pokemon somehow awakens during test - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BAD_DREAMS); + game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]); + game.override.enemyAbility(Abilities.BAD_DREAMS); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -411,16 +380,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async() => { //Tests the abilities Innards Out/Aftermath - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.AFTERMATH); + game.override.moveset([Moves.TACKLE]); + game.override.enemyAbility(Abilities.AFTERMATH); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); enemyPokemon.hp = 1; game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE)); @@ -438,16 +405,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async() => { //Tests the abilities Iron Barbs/Rough Skin - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.IRON_BARBS); + game.override.moveset([Moves.TACKLE]); + game.override.enemyAbility(Abilities.IRON_BARBS); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE)); await game.phaseInterceptor.to(TurnEndPhase); @@ -464,16 +429,14 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async() => { //Tests the ability Liquid Ooze - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.LIQUID_OOZE); + game.override.moveset([Moves.ABSORB]); + game.override.enemyAbility(Abilities.LIQUID_OOZE); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.ABSORB)); await game.phaseInterceptor.to(TurnEndPhase); @@ -490,12 +453,11 @@ describe("Abilities - Magic Guard", () => { it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async() => { //Tests the abilities Solar Power/Dry Skin - vi.spyOn(overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SOLAR_POWER); - vi.spyOn(overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(WeatherType.SUNNY); + game.override.passiveAbility(Abilities.SOLAR_POWER); + game.override.weather(WeatherType.SUNNY); await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); await game.phaseInterceptor.to(TurnEndPhase); diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index 469a4e2947f..f99068dea41 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -1,12 +1,8 @@ import { BattleStat } from "#app/data/battle-stat"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - EnemyCommandPhase, - VictoryPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, EnemyCommandPhase, VictoryPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/abilities/parental_bond.test.ts b/src/test/abilities/parental_bond.test.ts index bc7be2fae96..45d65fca083 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -8,9 +8,9 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/pastel_veil.test.ts b/src/test/abilities/pastel_veil.test.ts index f19b395677f..8035d54a7e5 100644 --- a/src/test/abilities/pastel_veil.test.ts +++ b/src/test/abilities/pastel_veil.test.ts @@ -1,14 +1,10 @@ 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 GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; -import { - CommandPhase, - TurnEndPhase, -} from "#app/phases"; +import { CommandPhase, TurnEndPhase } from "#app/phases"; import { Moves } from "#enums/moves"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { StatusEffect } from "#app/data/status-effect.js"; import { allAbilities } from "#app/data/ability.js"; import { Abilities } from "#app/enums/abilities.js"; @@ -30,11 +26,11 @@ describe("Abilities - Pastel Veil", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD]); + game.override.battleType("double"); + game.override.moveset([Moves.SPLASH]); + game.override.enemyAbility(Abilities.BALL_FETCH); + game.override.enemySpecies(Species.MAGIKARP); + game.override.enemyMoveset([Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD]); }); it("prevents the user and its allies from being afflicted by poison", async () => { diff --git a/src/test/abilities/power_spot.test.ts b/src/test/abilities/power_spot.test.ts index 441b405fd06..368f8a48110 100644 --- a/src/test/abilities/power_spot.test.ts +++ b/src/test/abilities/power_spot.test.ts @@ -1,13 +1,13 @@ import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Power Spot", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index d02c87662cf..7c6cca2eccd 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -10,9 +10,9 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/quick_draw.test.ts b/src/test/abilities/quick_draw.test.ts index e6177639bac..56f21cab838 100644 --- a/src/test/abilities/quick_draw.test.ts +++ b/src/test/abilities/quick_draw.test.ts @@ -1,7 +1,7 @@ import { allAbilities, BypassSpeedChanceAbAttr } from "#app/data/ability"; import { FaintPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/abilities/sand_spit.test.ts b/src/test/abilities/sand_spit.test.ts index de75ba833dd..dacfe7ad27e 100644 --- a/src/test/abilities/sand_spit.test.ts +++ b/src/test/abilities/sand_spit.test.ts @@ -1,10 +1,10 @@ -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; 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, it } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { WeatherType } from "#app/enums/weather-type.js"; diff --git a/src/test/abilities/sand_veil.test.ts b/src/test/abilities/sand_veil.test.ts index 4394df3ce97..6aab362634a 100644 --- a/src/test/abilities/sand_veil.test.ts +++ b/src/test/abilities/sand_veil.test.ts @@ -7,8 +7,8 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; @@ -45,10 +45,6 @@ describe("Abilities - Sand Veil", () => { await game.startBattle([Species.SNORLAX, Species.BLISSEY]); const leadPokemon = game.scene.getPlayerField(); - leadPokemon.forEach(p => expect(p).toBeDefined()); - - const enemyPokemon = game.scene.getEnemyField(); - enemyPokemon.forEach(p => expect(p).toBeDefined()); vi.spyOn(leadPokemon[0], "getAbility").mockReturnValue(allAbilities[Abilities.SAND_VEIL]); diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index 2ed1df05652..20a677a3244 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -1,10 +1,8 @@ import { BattleStat } from "#app/data/battle-stat.js"; import { TerrainType } from "#app/data/terrain.js"; -import { - MoveEndPhase, TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEndPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; diff --git a/src/test/abilities/screen_cleaner.test.ts b/src/test/abilities/screen_cleaner.test.ts index 2d2dc70b907..a73f56dd3eb 100644 --- a/src/test/abilities/screen_cleaner.test.ts +++ b/src/test/abilities/screen_cleaner.test.ts @@ -1,7 +1,7 @@ import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { PostSummonPhase, TurnEndPhase, } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/abilities/serene_grace.test.ts b/src/test/abilities/serene_grace.test.ts index 13da444454e..25ffc2ed2c6 100644 --- a/src/test/abilities/serene_grace.test.ts +++ b/src/test/abilities/serene_grace.test.ts @@ -1,11 +1,8 @@ import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - MoveEffectPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import * as Utils from "#app/utils"; diff --git a/src/test/abilities/sheer_force.test.ts b/src/test/abilities/sheer_force.test.ts index 1e7657611a1..8d315e3caad 100644 --- a/src/test/abilities/sheer_force.test.ts +++ b/src/test/abilities/sheer_force.test.ts @@ -1,11 +1,8 @@ import { applyAbAttrs, applyPostDefendAbAttrs, applyPreAttackAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr } from "#app/data/ability"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - MoveEffectPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import * as Utils from "#app/utils"; diff --git a/src/test/abilities/shield_dust.test.ts b/src/test/abilities/shield_dust.test.ts index 35e4015e8bc..6050e6d4c9a 100644 --- a/src/test/abilities/shield_dust.test.ts +++ b/src/test/abilities/shield_dust.test.ts @@ -1,11 +1,8 @@ import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - MoveEffectPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import * as Utils from "#app/utils"; diff --git a/src/test/abilities/steely_spirit.test.ts b/src/test/abilities/steely_spirit.test.ts index 7ac78eb11fa..e21067539df 100644 --- a/src/test/abilities/steely_spirit.test.ts +++ b/src/test/abilities/steely_spirit.test.ts @@ -2,13 +2,13 @@ import { allAbilities } from "#app/data/ability.js"; import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { MoveEffectPhase, SelectTargetPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Steely Spirit", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/sturdy.test.ts b/src/test/abilities/sturdy.test.ts index 9bfb3bd0085..4caa7b0bd14 100644 --- a/src/test/abilities/sturdy.test.ts +++ b/src/test/abilities/sturdy.test.ts @@ -1,10 +1,7 @@ import { EnemyPokemon } from "#app/field/pokemon.js"; -import { - DamagePhase, - MoveEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { DamagePhase, MoveEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/abilities/sweet_veil.test.ts b/src/test/abilities/sweet_veil.test.ts index 5a8022958ad..19c1210b443 100644 --- a/src/test/abilities/sweet_veil.test.ts +++ b/src/test/abilities/sweet_veil.test.ts @@ -1,19 +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 GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; -import { - CommandPhase, - MoveEffectPhase, - MovePhase, - TurnEndPhase, -} from "#app/phases"; +import { CommandPhase, MoveEffectPhase, MovePhase, TurnEndPhase } from "#app/phases"; import { Moves } from "#enums/moves"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { Abilities } from "#app/enums/abilities.js"; import { BattlerIndex } from "#app/battle.js"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Sweet Veil", () => { let phaserGame: Phaser.Game; @@ -31,11 +26,11 @@ describe("Abilities - Sweet Veil", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.REST]); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]); + game.override.battleType("double"); + game.override.moveset([Moves.SPLASH, Moves.REST]); + game.override.enemySpecies(Species.MAGIKARP); + game.override.enemyAbility(Abilities.BALL_FETCH); + game.override.enemyMoveset([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]); }); it("prevents the user and its allies from falling asleep", async () => { @@ -50,7 +45,7 @@ describe("Abilities - Sweet Veil", () => { }); it("causes Rest to fail when used by the user or its allies", async () => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); + game.override.enemyMoveset(SPLASH_ONLY); await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -62,7 +57,7 @@ describe("Abilities - Sweet Veil", () => { }); it("causes Yawn to fail if used on the user or its allies", async () => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]); + game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]); await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); @@ -74,10 +69,10 @@ describe("Abilities - Sweet Veil", () => { }); it("prevents the user and its allies already drowsy due to Yawn from falling asleep.", async () => { - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.PIKACHU); - vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]); + game.override.enemySpecies(Species.PIKACHU); + game.override.enemyLevel(5); + game.override.startingLevel(5); + game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]); await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]); diff --git a/src/test/abilities/unseen_fist.test.ts b/src/test/abilities/unseen_fist.test.ts index 2156c5eb588..0ee4dbef513 100644 --- a/src/test/abilities/unseen_fist.test.ts +++ b/src/test/abilities/unseen_fist.test.ts @@ -4,8 +4,8 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 419c3a612d5..985459e133b 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -1,9 +1,7 @@ import { BattleStat } from "#app/data/battle-stat.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; diff --git a/src/test/abilities/wind_power.test.ts b/src/test/abilities/wind_power.test.ts index cfdb2e745fe..8a4c2969cc4 100644 --- a/src/test/abilities/wind_power.test.ts +++ b/src/test/abilities/wind_power.test.ts @@ -1,15 +1,13 @@ import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Wind Power", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index 88da929fbf1..855def63b6f 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -1,15 +1,13 @@ import { BattleStat } from "#app/data/battle-stat.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Wind Rider", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/wonder_skin.test.ts b/src/test/abilities/wonder_skin.test.ts index bc964134e45..a2815152df6 100644 --- a/src/test/abilities/wonder_skin.test.ts +++ b/src/test/abilities/wonder_skin.test.ts @@ -1,14 +1,14 @@ import { allAbilities } from "#app/data/ability.js"; import { allMoves } from "#app/data/move.js"; import { MoveEffectPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Wonder Skin", () => { let phaserGame: Phaser.Game; diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index 8f4c8b42af5..f11694b061c 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -1,20 +1,9 @@ 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, - EnemyCommandPhase, - MessagePhase, - PostSummonPhase, - SwitchPhase, - SwitchSummonPhase, - TurnEndPhase, - TurnInitPhase, - TurnStartPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, DamagePhase, EnemyCommandPhase, MessagePhase, PostSummonPhase, SwitchPhase, SwitchSummonPhase, TurnEndPhase, TurnInitPhase, TurnStartPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/achievements/achievement.test.ts b/src/test/achievements/achievement.test.ts index 83d24d1f0ee..14466a71086 100644 --- a/src/test/achievements/achievement.test.ts +++ b/src/test/achievements/achievement.test.ts @@ -1,6 +1,6 @@ import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js"; import { Achv, AchvTier, DamageAchv, HealAchv, LevelAchv, ModifierAchv, MoneyAchv, RibbonAchv, achvs } from "#app/system/achv"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { IntegerHolder, NumberHolder } from "#app/utils.js"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/src/test/arena/arena_gravity.test.ts b/src/test/arena/arena_gravity.test.ts index f89846dd999..66d6994fb80 100644 --- a/src/test/arena/arena_gravity.test.ts +++ b/src/test/arena/arena_gravity.test.ts @@ -1,12 +1,9 @@ import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; -import { - MoveEffectPhase, - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/arena/weather_fog.test.ts b/src/test/arena/weather_fog.test.ts index 9b0630f5c2b..e5718b73a3c 100644 --- a/src/test/arena/weather_fog.test.ts +++ b/src/test/arena/weather_fog.test.ts @@ -1,11 +1,9 @@ import { allMoves } from "#app/data/move.js"; import { WeatherType } from "#app/data/weather.js"; import { Abilities } from "#app/enums/abilities.js"; -import { - MoveEffectPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/arena/weather_strong_winds.test.ts b/src/test/arena/weather_strong_winds.test.ts index 6c977401f20..0fd45173033 100644 --- a/src/test/arena/weather_strong_winds.test.ts +++ b/src/test/arena/weather_strong_winds.test.ts @@ -1,9 +1,7 @@ import { allMoves } from "#app/data/move.js"; -import { - TurnStartPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnStartPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/battle-stat.spec.ts b/src/test/battle-stat.spec.ts index 46f25f66bcd..775dd40ff34 100644 --- a/src/test/battle-stat.spec.ts +++ b/src/test/battle-stat.spec.ts @@ -1,8 +1,4 @@ -import { - BattleStat, - getBattleStatLevelChangeDescription, - getBattleStatName, -} from "#app/data/battle-stat.js"; +import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat.js"; import { describe, expect, it } from "vitest"; import { arrayOfRange, mockI18next } from "./utils/testUtils"; diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 14ff1bcec0d..6aa919186b4 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -1,10 +1,7 @@ import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, EnemyCommandPhase, SelectTargetPhase, - TurnStartPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, EnemyCommandPhase, SelectTargetPhase, TurnStartPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import TargetSelectUiHandler from "#app/ui/target-select-ui-handler"; import { Mode } from "#app/ui/ui"; diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index a91cd1e8352..35eae9b96d2 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -1,20 +1,9 @@ import { allSpecies } from "#app/data/pokemon-species"; import { GameModes } from "#app/game-mode"; import { getGameMode } from "#app/game-mode.js"; -import { - CommandPhase, DamagePhase, - EncounterPhase, - EnemyCommandPhase, - LoginPhase, - SelectGenderPhase, - SelectModifierPhase, - SelectStarterPhase, - SummonPhase, - TitlePhase, - TurnInitPhase, VictoryPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { generateStarter, getMovePosition, } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, LoginPhase, SelectGenderPhase, SelectModifierPhase, SelectStarterPhase, SummonPhase, TitlePhase, TurnInitPhase, VictoryPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { generateStarter, getMovePosition, } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/battle/double_battle.test.ts b/src/test/battle/double_battle.test.ts index e2d8dee562c..fb73fd70099 100644 --- a/src/test/battle/double_battle.test.ts +++ b/src/test/battle/double_battle.test.ts @@ -1,14 +1,11 @@ -import { - BattleEndPhase, - TurnInitPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition, } from "#app/test/utils/gameManagerUtils"; +import { BattleEndPhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition, } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; import { Status, StatusEffect } from "#app/data/status-effect.js"; describe("Test Battle Phase", () => { @@ -43,8 +40,6 @@ describe("Test Battle Phase", () => { game.doAttack(getMovePosition(game.scene, 1, Moves.SPLASH)); for (const pokemon of game.scene.getPlayerField()) { - expect(pokemon).toBeDefined(); - pokemon.hp = 0; pokemon.status = new Status(StatusEffect.FAINT); expect(pokemon.isFainted()).toBe(true); diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index a823887b4f8..f244b57ce1b 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -1,4 +1,4 @@ -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/battle/special_battle.test.ts b/src/test/battle/special_battle.test.ts index e4243ea1418..b8a29e82f69 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -1,7 +1,5 @@ -import { - CommandPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import { CommandPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/src/test/eggs/egg.test.ts b/src/test/eggs/egg.test.ts index 91d1153edfc..0bc2972e2dc 100644 --- a/src/test/eggs/egg.test.ts +++ b/src/test/eggs/egg.test.ts @@ -1,4 +1,4 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import BattleScene from "../../battle-scene"; import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg.js"; import { Species } from "#enums/species"; @@ -6,7 +6,7 @@ import Phaser from "phaser"; import { EggSourceType } from "#app/enums/egg-source-types.js"; import { EggTier } from "#app/enums/egg-type.js"; import { VariantTier } from "#app/enums/variant-tiers.js"; -import GameManager from "../utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import EggData from "#app/system/egg-data.js"; import * as Utils from "#app/utils.js"; diff --git a/src/test/evolution.test.ts b/src/test/evolution.test.ts index 70682666f32..acb012741ff 100644 --- a/src/test/evolution.test.ts +++ b/src/test/evolution.test.ts @@ -1,7 +1,7 @@ import { pokemonEvolutions } from "#app/data/pokemon-evolutions.js"; import { Abilities } from "#app/enums/abilities.js"; import { Species } from "#app/enums/species.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/src/test/evolutions/evolutions.test.ts b/src/test/evolutions/evolutions.test.ts index 4e38e72bb7c..e6e9e0d56e2 100644 --- a/src/test/evolutions/evolutions.test.ts +++ b/src/test/evolutions/evolutions.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; import * as Utils from "#app/utils"; diff --git a/src/test/game-mode.test.ts b/src/test/game-mode.test.ts index 04376c20361..4a1960a05ff 100644 --- a/src/test/game-mode.test.ts +++ b/src/test/game-mode.test.ts @@ -1,13 +1,5 @@ import { GameMode, GameModes, getGameMode } from "#app/game-mode.js"; -import { - afterEach, - beforeAll, - beforeEach, - describe, - expect, - it, - vi, -} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import GameManager from "./utils/gameManager"; import * as Utils from "../utils"; describe("game-mode", () => { diff --git a/src/test/imports.test.ts b/src/test/imports.test.ts index 5c0272e191d..69c145236bc 100644 --- a/src/test/imports.test.ts +++ b/src/test/imports.test.ts @@ -1,5 +1,5 @@ -import { describe, expect, it} from "vitest"; -import {initStatsKeys} from "#app/ui/game-stats-ui-handler"; +import { describe, expect, it } from "vitest"; +import { initStatsKeys } from "#app/ui/game-stats-ui-handler"; async function importModule() { try { diff --git a/src/test/inputs/inputs.test.ts b/src/test/inputs/inputs.test.ts index 5acee145011..7182ac2c02c 100644 --- a/src/test/inputs/inputs.test.ts +++ b/src/test/inputs/inputs.test.ts @@ -1,9 +1,9 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; -import InputsHandler from "#app/test/utils/inputsHandler"; +import InputsHandler from "#test/utils/inputsHandler"; describe("Inputs", () => { diff --git a/src/test/internals.test.ts b/src/test/internals.test.ts index a54b8b01544..2ada42d0c8c 100644 --- a/src/test/internals.test.ts +++ b/src/test/internals.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Species } from "#app/enums/species.js"; import { Abilities } from "#app/enums/abilities.js"; diff --git a/src/test/items/eviolite.test.ts b/src/test/items/eviolite.test.ts index 5b18cc3a249..0fe90866de8 100644 --- a/src/test/items/eviolite.test.ts +++ b/src/test/items/eviolite.test.ts @@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat"; import { EvolutionStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Species } from "#enums/species"; import Phase from "phaser"; diff --git a/src/test/items/exp_booster.test.ts b/src/test/items/exp_booster.test.ts index e80b12d7fc9..7ea457eda1f 100644 --- a/src/test/items/exp_booster.test.ts +++ b/src/test/items/exp_booster.test.ts @@ -1,6 +1,6 @@ import { Abilities } from "#app/enums/abilities.js"; import { PokemonExpBoosterModifier } from "#app/modifier/modifier.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/src/test/items/grip_claw.test.ts b/src/test/items/grip_claw.test.ts index 495bc5de223..40ef81fed73 100644 --- a/src/test/items/grip_claw.test.ts +++ b/src/test/items/grip_claw.test.ts @@ -5,10 +5,10 @@ import { BerryType } from "#app/enums/berry-type.js"; import { Moves } from "#app/enums/moves.js"; import { Species } from "#app/enums/species.js"; import { CommandPhase, MoveEndPhase, SelectTargetPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; // 20 seconds @@ -54,11 +54,7 @@ describe("Items - Grip Claw", () => { async () => { await game.startBattle([Species.PANSEAR, Species.ROWLET, Species.PANPOUR, Species.PANSAGE, Species.CHARMANDER, Species.SQUIRTLE]); - const playerPokemon = game.scene.getPlayerField(); - playerPokemon.forEach(p => expect(p).toBeDefined()); - const enemyPokemon = game.scene.getEnemyField(); - enemyPokemon.forEach(p => expect(p).toBeDefined()); const enemyHeldItemCt = enemyPokemon.map(p => p.getHeldItems.length); diff --git a/src/test/items/leek.test.ts b/src/test/items/leek.test.ts index 73444a54c30..7a2dd369e4e 100644 --- a/src/test/items/leek.test.ts +++ b/src/test/items/leek.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { CritBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import { MoveEffectPhase, TurnStartPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/items/leftovers.test.ts b/src/test/items/leftovers.test.ts index 8c9195b07af..6850528a664 100644 --- a/src/test/items/leftovers.test.ts +++ b/src/test/items/leftovers.test.ts @@ -1,6 +1,6 @@ import { DamagePhase, TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -41,10 +41,6 @@ describe("Items - Leftovers", () => { expect(game.scene.modifiers[0].type.id).toBe("LEFTOVERS"); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); // We should have full hp expect(leadPokemon.isFullHp()).toBe(true); diff --git a/src/test/items/light_ball.test.ts b/src/test/items/light_ball.test.ts index eb0c6cc044f..fef5793d26c 100644 --- a/src/test/items/light_ball.test.ts +++ b/src/test/items/light_ball.test.ts @@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Species } from "#enums/species"; import Phase from "phaser"; diff --git a/src/test/items/metal_powder.test.ts b/src/test/items/metal_powder.test.ts index 937fd8feb62..da5d9109c9a 100644 --- a/src/test/items/metal_powder.test.ts +++ b/src/test/items/metal_powder.test.ts @@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Species } from "#enums/species"; import Phase from "phaser"; diff --git a/src/test/items/quick_powder.test.ts b/src/test/items/quick_powder.test.ts index e662b398cd4..939d25070bc 100644 --- a/src/test/items/quick_powder.test.ts +++ b/src/test/items/quick_powder.test.ts @@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Species } from "#enums/species"; import Phase from "phaser"; diff --git a/src/test/items/scope_lens.test.ts b/src/test/items/scope_lens.test.ts index c9fb3ba52d3..59702ee51ac 100644 --- a/src/test/items/scope_lens.test.ts +++ b/src/test/items/scope_lens.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { CritBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import { MoveEffectPhase, TurnStartPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/items/thick_club.test.ts b/src/test/items/thick_club.test.ts index 13714c441c0..6b56cf98099 100644 --- a/src/test/items/thick_club.test.ts +++ b/src/test/items/thick_club.test.ts @@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import * as Utils from "#app/utils"; import { Species } from "#enums/species"; import Phase from "phaser"; diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 2f2b7e4e16a..b5e9b6c4d65 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -1,13 +1,8 @@ import { StatusEffect } from "#app/data/status-effect"; -import { - CommandPhase, - EnemyCommandPhase, - MessagePhase, - TurnEndPhase, -} from "#app/phases"; +import { CommandPhase, EnemyCommandPhase, MessagePhase, TurnEndPhase } from "#app/phases"; import i18next, { initI18n } from "#app/plugins/i18n"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/localization/battle-stat.test.ts b/src/test/localization/battle-stat.test.ts index ea2714b3852..b99ed2b7064 100644 --- a/src/test/localization/battle-stat.test.ts +++ b/src/test/localization/battle-stat.test.ts @@ -1,27 +1,26 @@ -import {beforeAll, describe, expect, it} from "vitest"; -import {getBattleStatName, getBattleStatLevelChangeDescription} from "#app/data/battle-stat.js"; -import {BattleStat} from "#app/data/battle-stat.js"; -import {pokemonInfo as enPokemonInfo} from "#app/locales/en/pokemon-info.js"; -import {battle as enBattleStat} from "#app/locales/en/battle.js"; -import {pokemonInfo as dePokemonInfo} from "#app/locales/de/pokemon-info.js"; -import {battle as deBattleStat} from "#app/locales/de/battle.js"; -import {pokemonInfo as esPokemonInfo} from "#app/locales/es/pokemon-info.js"; -import {battle as esBattleStat} from "#app/locales/es/battle.js"; -import {pokemonInfo as frPokemonInfo} from "#app/locales/fr/pokemon-info.js"; -import {battle as frBattleStat} from "#app/locales/fr/battle.js"; -import {pokemonInfo as itPokemonInfo} from "#app/locales/it/pokemon-info.js"; -import {battle as itBattleStat} from "#app/locales/it/battle.js"; -import {pokemonInfo as koPokemonInfo} from "#app/locales/ko/pokemon-info.js"; -import {battle as koBattleStat} from "#app/locales/ko/battle.js"; -import {pokemonInfo as ptBrPokemonInfo} from "#app/locales/pt_BR/pokemon-info.js"; -import {battle as ptBrBattleStat} from "#app/locales/pt_BR/battle.js"; -import {pokemonInfo as zhCnPokemonInfo} from "#app/locales/zh_CN/pokemon-info.js"; -import {battle as zhCnBattleStat} from "#app/locales/zh_CN/battle.js"; -import {pokemonInfo as zhTwPokemonInfo} from "#app/locales/zh_TW/pokemon-info.js"; -import {battle as zhTwBattleStat} from "#app/locales/zh_TW/battle.js"; - -import i18next, {initI18n} from "#app/plugins/i18n"; -import {KoreanPostpositionProcessor} from "i18next-korean-postposition-processor"; +import { beforeAll, describe, expect, it } from "vitest"; +import { getBattleStatName, getBattleStatLevelChangeDescription } from "#app/data/battle-stat.js"; +import { BattleStat} from "#app/data/battle-stat.js"; +import { pokemonInfo as enPokemonInfo } from "#app/locales/en/pokemon-info.js"; +import { battle as enBattleStat } from "#app/locales/en/battle.js"; +import { pokemonInfo as dePokemonInfo } from "#app/locales/de/pokemon-info.js"; +import { battle as deBattleStat } from "#app/locales/de/battle.js"; +import { pokemonInfo as esPokemonInfo } from "#app/locales/es/pokemon-info.js"; +import { battle as esBattleStat } from "#app/locales/es/battle.js"; +import { pokemonInfo as frPokemonInfo } from "#app/locales/fr/pokemon-info.js"; +import { battle as frBattleStat } from "#app/locales/fr/battle.js"; +import { pokemonInfo as itPokemonInfo } from "#app/locales/it/pokemon-info.js"; +import { battle as itBattleStat } from "#app/locales/it/battle.js"; +import { pokemonInfo as koPokemonInfo } from "#app/locales/ko/pokemon-info.js"; +import { battle as koBattleStat } from "#app/locales/ko/battle.js"; +import { pokemonInfo as ptBrPokemonInfo } from "#app/locales/pt_BR/pokemon-info.js"; +import { battle as ptBrBattleStat } from "#app/locales/pt_BR/battle.js"; +import { pokemonInfo as zhCnPokemonInfo } from "#app/locales/zh_CN/pokemon-info.js"; +import { battle as zhCnBattleStat } from "#app/locales/zh_CN/battle.js"; +import { pokemonInfo as zhTwPokemonInfo } from "#app/locales/zh_TW/pokemon-info.js"; +import { battle as zhTwBattleStat } from "#app/locales/zh_TW/battle.js"; +import i18next, { initI18n } from "#app/plugins/i18n"; +import { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor"; interface BattleStatTestUnit { stat: BattleStat, diff --git a/src/test/localization/french.test.ts b/src/test/localization/french.test.ts index 45429b1b157..b03a8ee64e8 100644 --- a/src/test/localization/french.test.ts +++ b/src/test/localization/french.test.ts @@ -1,9 +1,9 @@ -import {afterEach, beforeAll, describe, expect, it} from "vitest"; +import { afterEach, beforeAll, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import {Species} from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import { Species } from "#enums/species"; import i18next from "i18next"; -import {initI18n} from "#app/plugins/i18n"; +import { initI18n } from "#app/plugins/i18n"; describe("Lokalization - french", () => { let phaserGame: Phaser.Game; diff --git a/src/test/localization/status-effect.test.ts b/src/test/localization/status-effect.test.ts index ad33a59a675..8a9effe1672 100644 --- a/src/test/localization/status-effect.test.ts +++ b/src/test/localization/status-effect.test.ts @@ -1,14 +1,7 @@ import { beforeAll, describe, afterEach, expect, it, vi } from "vitest"; -import { - StatusEffect, - getStatusEffectActivationText, - getStatusEffectDescriptor, - getStatusEffectHealText, - getStatusEffectObtainText, - getStatusEffectOverlapText, -} from "#app/data/status-effect"; +import { StatusEffect, getStatusEffectActivationText, getStatusEffectDescriptor, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect"; import i18next from "i18next"; -import { mockI18next } from "../utils/testUtils"; +import { mockI18next } from "#test/utils/testUtils"; const pokemonName = "PKM"; const sourceText = "SOURCE"; diff --git a/src/test/localization/terrain.test.ts b/src/test/localization/terrain.test.ts index 6450d8574be..f97b7813948 100644 --- a/src/test/localization/terrain.test.ts +++ b/src/test/localization/terrain.test.ts @@ -1,11 +1,11 @@ import { TerrainType, getTerrainName } from "#app/data/terrain"; import { getTerrainBlockMessage, getTerrainClearMessage, getTerrainStartMessage } from "#app/data/weather"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { mockI18next } from "../utils/testUtils"; +import { mockI18next } from "#test/utils/testUtils"; describe("terrain", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/astonish.test.ts b/src/test/moves/astonish.test.ts index c8c013026b3..c5d59f82102 100644 --- a/src/test/moves/astonish.test.ts +++ b/src/test/moves/astonish.test.ts @@ -6,8 +6,8 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; @@ -44,10 +44,8 @@ describe("Moves - Astonish", () => { await game.startBattle([Species.MEOWSCARADA]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); game.doAttack(getMovePosition(game.scene, 0, Moves.ASTONISH)); diff --git a/src/test/moves/aurora_veil.test.ts b/src/test/moves/aurora_veil.test.ts index 80da8087576..f98e9e9cc0c 100644 --- a/src/test/moves/aurora_veil.test.ts +++ b/src/test/moves/aurora_veil.test.ts @@ -4,11 +4,9 @@ import { WeatherType } from "#app/data/weather.js"; import { Abilities } from "#app/enums/abilities.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import Pokemon from "#app/field/pokemon.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { NumberHolder } from "#app/utils.js"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/beat_up.test.ts b/src/test/moves/beat_up.test.ts index 751b91fefa3..e720c625956 100644 --- a/src/test/moves/beat_up.test.ts +++ b/src/test/moves/beat_up.test.ts @@ -1,11 +1,10 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import Overrides from "#app/overrides"; +import GameManager from "#test/utils/gameManager"; import { Species } from "#app/enums/species.js"; import { Moves } from "#app/enums/moves.js"; import { Abilities } from "#app/enums/abilities.js"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { MoveEffectPhase } from "#app/phases.js"; import { StatusEffect } from "#app/enums/status-effect.js"; @@ -27,15 +26,15 @@ describe("Moves - Beat Up", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); + game.override.battleType("single"); - vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX); - vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.SPLASH)); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemySpecies(Species.SNORLAX); + game.override.enemyLevel(100); + game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyAbility(Abilities.INSOMNIA); - vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BEAT_UP]); + game.override.startingLevel(100); + game.override.moveset([Moves.BEAT_UP]); }); it( @@ -82,7 +81,7 @@ describe("Moves - Beat Up", () => { it( "should hit twice for each player Pokemon if the user has Multi-Lens", async () => { - vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]); + game.override.startingHeldItems([{name: "MULTI_LENS", count: 1}]); await game.startBattle([Species.MAGIKARP, Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, Species.PIKACHU, Species.EEVEE]); const playerPokemon = game.scene.getPlayerPokemon(); diff --git a/src/test/moves/belly_drum.test.ts b/src/test/moves/belly_drum.test.ts index 5a9ddd41f0f..5bb27394805 100644 --- a/src/test/moves/belly_drum.test.ts +++ b/src/test/moves/belly_drum.test.ts @@ -1,11 +1,8 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { - TurnEndPhase, -} from "#app/phases"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { TurnEndPhase } from "#app/phases"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { BattleStat } from "#app/data/battle-stat"; @@ -32,10 +29,10 @@ describe("Moves - BELLY DRUM", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); + game.override.starterSpecies(Species.MAGIKARP); + game.override.enemySpecies(Species.SNORLAX); + game.override.startingLevel(100); + game.override.enemyLevel(100); game.override.moveset([Moves.BELLY_DRUM]); game.override.enemyMoveset([Moves.SPLASH]); }); @@ -47,7 +44,6 @@ describe("Moves - BELLY DRUM", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); game.doAttack(getMovePosition(game.scene, 0, Moves.BELLY_DRUM)); @@ -63,7 +59,6 @@ describe("Moves - BELLY DRUM", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); // Here - BattleStat.ATK -> -3 and BattleStat.SPATK -> 6 @@ -84,7 +79,6 @@ describe("Moves - BELLY DRUM", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; @@ -101,7 +95,6 @@ describe("Moves - BELLY DRUM", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); leadPokemon.hp = hpLost - PREDAMAGE; diff --git a/src/test/moves/ceaseless_edge.test.ts b/src/test/moves/ceaseless_edge.test.ts index ab3da3d51b8..288ea6ac277 100644 --- a/src/test/moves/ceaseless_edge.test.ts +++ b/src/test/moves/ceaseless_edge.test.ts @@ -2,12 +2,9 @@ import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; import { allMoves } from "#app/data/move"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { - MoveEffectPhase, - TurnEndPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; @@ -48,11 +45,7 @@ describe("Moves - Ceaseless Edge", () => { async () => { await game.startBattle([ Species.ILLUMISE ]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); const enemyStartingHp = enemyPokemon.hp; @@ -77,11 +70,7 @@ describe("Moves - Ceaseless Edge", () => { game.override.startingHeldItems([{name: "MULTI_LENS"}]); await game.startBattle([ Species.ILLUMISE ]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); const enemyStartingHp = enemyPokemon.hp; @@ -108,12 +97,6 @@ describe("Moves - Ceaseless Edge", () => { await game.startBattle([ Species.ILLUMISE ]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); - game.doAttack(getMovePosition(game.scene, 0, Moves.CEASELESS_EDGE)); await game.phaseInterceptor.to(MoveEffectPhase, false); // Spikes should not have any layers before move effect is applied diff --git a/src/test/moves/clangorous_soul.test.ts b/src/test/moves/clangorous_soul.test.ts index 1b3d16f402f..251225e7068 100644 --- a/src/test/moves/clangorous_soul.test.ts +++ b/src/test/moves/clangorous_soul.test.ts @@ -1,19 +1,17 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { - TurnEndPhase, -} from "#app/phases"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { TurnEndPhase } from "#app/phases"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { BattleStat } from "#app/data/battle-stat"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; -// RATIO : HP Cost of Move +/** HP Cost of Move */ const RATIO = 3; -// PREDAMAGE : Amount of extra HP lost +/** Amount of extra HP lost */ const PREDAMAGE = 15; describe("Moves - CLANGOROUS_SOUL", () => { @@ -32,12 +30,12 @@ describe("Moves - CLANGOROUS_SOUL", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); + game.override.starterSpecies(Species.MAGIKARP); + game.override.enemySpecies(Species.SNORLAX); + game.override.startingLevel(100); + game.override.enemyLevel(100); game.override.moveset([Moves.CLANGOROUS_SOUL]); - game.override.enemyMoveset([Moves.SPLASH]); + game.override.enemyMoveset(SPLASH_ONLY); }); //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move) @@ -47,7 +45,6 @@ describe("Moves - CLANGOROUS_SOUL", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); game.doAttack(getMovePosition(game.scene, 0, Moves.CLANGOROUS_SOUL)); @@ -67,7 +64,6 @@ describe("Moves - CLANGOROUS_SOUL", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); //Here - BattleStat.SPD -> 0 and BattleStat.SPDEF -> 4 @@ -93,7 +89,6 @@ describe("Moves - CLANGOROUS_SOUL", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; leadPokemon.summonData.battleStats[BattleStat.DEF] = 6; @@ -118,7 +113,6 @@ describe("Moves - CLANGOROUS_SOUL", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); leadPokemon.hp = hpLost - PREDAMAGE; diff --git a/src/test/moves/double_team.test.ts b/src/test/moves/double_team.test.ts index 55820ee957b..48b322f5f11 100644 --- a/src/test/moves/double_team.test.ts +++ b/src/test/moves/double_team.test.ts @@ -1,10 +1,8 @@ import { BattleStat } from "#app/data/battle-stat.js"; import { Abilities } from "#app/enums/abilities.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/dragon_rage.test.ts b/src/test/moves/dragon_rage.test.ts index b38a6f16513..2facff3428f 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -4,14 +4,14 @@ import { Species } from "#app/enums/species.js"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import { modifierTypes } from "#app/modifier/modifier-type"; import { TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Dragon Rage", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/dynamax_cannon.test.ts b/src/test/moves/dynamax_cannon.test.ts index 4c010484c78..8af6a624797 100644 --- a/src/test/moves/dynamax_cannon.test.ts +++ b/src/test/moves/dynamax_cannon.test.ts @@ -1,8 +1,8 @@ import { BattlerIndex } from "#app/battle"; import { allMoves } from "#app/data/move"; import { DamagePhase, MoveEffectPhase, TurnStartPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/fillet_away.test.ts b/src/test/moves/fillet_away.test.ts index 161bba2c284..a3922b18468 100644 --- a/src/test/moves/fillet_away.test.ts +++ b/src/test/moves/fillet_away.test.ts @@ -1,19 +1,17 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { - TurnEndPhase, -} from "#app/phases"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { TurnEndPhase } from "#app/phases"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { BattleStat } from "#app/data/battle-stat"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; -// RATIO : HP Cost of Move +/** HP Cost of Move */ const RATIO = 2; -// PREDAMAGE : Amount of extra HP lost +/** Amount of extra HP lost */ const PREDAMAGE = 15; describe("Moves - FILLET AWAY", () => { @@ -32,12 +30,12 @@ describe("Moves - FILLET AWAY", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); + game.override.starterSpecies(Species.MAGIKARP); + game.override.enemySpecies(Species.SNORLAX); + game.override.startingLevel(100); + game.override.enemyLevel(100); game.override.moveset([Moves.FILLET_AWAY]); - game.override.enemyMoveset([Moves.SPLASH]); + game.override.enemyMoveset(SPLASH_ONLY); }); //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move) @@ -47,7 +45,6 @@ describe("Moves - FILLET AWAY", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); game.doAttack(getMovePosition(game.scene, 0, Moves.FILLET_AWAY)); @@ -65,7 +62,6 @@ describe("Moves - FILLET AWAY", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); //Here - BattleStat.SPD -> 0 and BattleStat.SPATK -> 3 @@ -87,7 +83,6 @@ describe("Moves - FILLET AWAY", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6; @@ -108,7 +103,6 @@ describe("Moves - FILLET AWAY", () => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); leadPokemon.hp = hpLost - PREDAMAGE; diff --git a/src/test/moves/fissure.test.ts b/src/test/moves/fissure.test.ts index 940c32e975a..f2f58212209 100644 --- a/src/test/moves/fissure.test.ts +++ b/src/test/moves/fissure.test.ts @@ -2,13 +2,13 @@ import { BattleStat } from "#app/data/battle-stat"; import { Species } from "#app/enums/species.js"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import { DamagePhase, TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Fissure", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/flame_burst.test.ts b/src/test/moves/flame_burst.test.ts index 69d11c79f93..0f9e311ca86 100644 --- a/src/test/moves/flame_burst.test.ts +++ b/src/test/moves/flame_burst.test.ts @@ -1,14 +1,10 @@ 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 GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; -import { - SelectTargetPhase, - TurnEndPhase, -} from "#app/phases"; +import { SelectTargetPhase, TurnEndPhase } from "#app/phases"; import { Moves } from "#enums/moves"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#app/enums/abilities.js"; import { allAbilities } from "#app/data/ability.js"; import Pokemon from "#app/field/pokemon.js"; @@ -40,14 +36,14 @@ describe("Moves - Flame Burst", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLAME_BURST, Moves.SPLASH]); - vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); - vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); - vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(new Array(4).fill(Moves.SPLASH)); + game.override.battleType("double"); + game.override.moveset([Moves.FLAME_BURST, Moves.SPLASH]); + game.override.disableCrits(); + game.override.ability(Abilities.UNNERVE); + game.override.startingWave(4); + game.override.enemySpecies(Species.SHUCKLE); + game.override.enemyAbility(Abilities.BALL_FETCH); + game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH)); }); it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => { @@ -65,7 +61,7 @@ describe("Moves - Flame Burst", () => { }); it("does not inflict damage to the target's ally if the target was not affected by Flame Burst", async () => { - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FLASH_FIRE); + game.override.enemyAbility(Abilities.FLASH_FIRE); await game.startBattle([Species.PIKACHU, Species.PIKACHU]); const [ leftEnemy, rightEnemy ] = game.scene.getEnemyField(); diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index 82476ab5b90..a00c84f8714 100644 --- a/src/test/moves/flower_shield.test.ts +++ b/src/test/moves/flower_shield.test.ts @@ -2,17 +2,15 @@ import { BattleStat } from "#app/data/battle-stat.js"; import { SemiInvulnerableTag } from "#app/data/battler-tags.js"; import { Type } from "#app/data/type.js"; import { Biome } from "#app/enums/biome.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Flower Shield", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/follow_me.test.ts b/src/test/moves/follow_me.test.ts index eb41bf55a02..420dd7e0762 100644 --- a/src/test/moves/follow_me.test.ts +++ b/src/test/moves/follow_me.test.ts @@ -1,13 +1,9 @@ import { BattlerIndex } from "#app/battle.js"; import { Stat } from "#app/data/pokemon-stat"; import { Abilities } from "#app/enums/abilities.js"; -import { - CommandPhase, - SelectTargetPhase, - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/fusion_bolt.test.ts b/src/test/moves/fusion_bolt.test.ts index 368c75b0f54..3ba4148db9f 100644 --- a/src/test/moves/fusion_bolt.test.ts +++ b/src/test/moves/fusion_bolt.test.ts @@ -1,8 +1,7 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Species } from "#enums/species"; import { Moves } from "#enums/moves"; import { Abilities } from "#enums/abilities"; @@ -25,16 +24,16 @@ describe("Moves - Fusion Bolt", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionBolt ]); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1); + game.override.moveset([ fusionBolt ]); + game.override.startingLevel(1); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ROUGH_SKIN); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); + game.override.enemySpecies(Species.RESHIRAM); + game.override.enemyAbility(Abilities.ROUGH_SKIN); + game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); - vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97); - vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); + game.override.battleType("single"); + game.override.startingWave(97); + game.override.disableCrits(); }); it("should not make contact", async() => { diff --git a/src/test/moves/fusion_flare.test.ts b/src/test/moves/fusion_flare.test.ts index 5ccbd82d25e..9862995be32 100644 --- a/src/test/moves/fusion_flare.test.ts +++ b/src/test/moves/fusion_flare.test.ts @@ -1,9 +1,8 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import overrides from "#app/overrides"; +import GameManager from "#test/utils/gameManager"; import { TurnStartPhase } from "#app/phases"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { StatusEffect } from "#app/data/status-effect"; import { Species } from "#enums/species"; import { Moves } from "#enums/moves"; @@ -26,15 +25,15 @@ describe("Moves - Fusion Flare", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare ]); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1); + game.override.moveset([ fusionFlare ]); + game.override.startingLevel(1); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]); + game.override.enemySpecies(Species.RESHIRAM); + game.override.enemyMoveset([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]); - vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97); - vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); + game.override.battleType("single"); + game.override.startingWave(97); + game.override.disableCrits(); }); it("should thaw freeze status condition", async() => { diff --git a/src/test/moves/fusion_flare_bolt.test.ts b/src/test/moves/fusion_flare_bolt.test.ts index 83c7c0e5993..e04d766f848 100644 --- a/src/test/moves/fusion_flare_bolt.test.ts +++ b/src/test/moves/fusion_flare_bolt.test.ts @@ -1,9 +1,8 @@ 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 GameManager from "#test/utils/gameManager"; import { MoveEffectPhase, MovePhase, MoveEndPhase, TurnStartPhase, DamagePhase } from "#app/phases"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Stat } from "#app/data/pokemon-stat"; import { allMoves } from "#app/data/move"; import { BattlerIndex } from "#app/battle"; @@ -29,15 +28,15 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionBolt.id ]); - vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1); + game.override.moveset([ fusionFlare.id, fusionBolt.id ]); + game.override.startingLevel(1); - vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM); - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]); + game.override.enemySpecies(Species.RESHIRAM); + game.override.enemyMoveset([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]); - vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97); - vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); + game.override.battleType("double"); + game.override.startingWave(97); + game.override.disableCrits(); vi.spyOn(fusionFlare, "calculateBattlePower"); vi.spyOn(fusionBolt, "calculateBattlePower"); @@ -133,7 +132,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }, 20000); it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async() => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); + game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); await game.startBattle([ Species.ZEKROM, Species.ZEKROM @@ -194,7 +193,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }, 20000); it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async() => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]); + game.override.enemyMoveset([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]); await game.startBattle([ Species.ZEKROM, Species.ZEKROM @@ -258,7 +257,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }, 20000); it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async() => { - vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]); + game.override.enemyMoveset([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]); await game.startBattle([ Species.ZEKROM, Species.ZEKROM diff --git a/src/test/moves/gastro_acid.test.ts b/src/test/moves/gastro_acid.test.ts index 0ffa8d9180b..cd1f0e4ab12 100644 --- a/src/test/moves/gastro_acid.test.ts +++ b/src/test/moves/gastro_acid.test.ts @@ -1,15 +1,13 @@ import { BattlerIndex } from "#app/battle.js"; import { Stat } from "#app/data/pokemon-stat.js"; import { Abilities } from "#app/enums/abilities.js"; -import { - Moves -} from "#app/enums/moves.js"; +import { Moves } from "#app/enums/moves.js"; import { Species } from "#app/enums/species.js"; import { MoveResult } from "#app/field/pokemon.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import GameManager from "../utils/gameManager"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index 9548694183c..fc9f6ee1c7f 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -1,8 +1,8 @@ import { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { DamagePhase, TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index 3d4a37fda73..bfa3cc54896 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -1,12 +1,8 @@ import { BattleStat } from "#app/data/battle-stat"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - EnemyCommandPhase, - TurnInitPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, EnemyCommandPhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/moves/hard_press.test.ts b/src/test/moves/hard_press.test.ts index 89f8e14169f..6a45e49137b 100644 --- a/src/test/moves/hard_press.test.ts +++ b/src/test/moves/hard_press.test.ts @@ -1,15 +1,13 @@ import { allMoves } from "#app/data/move.js"; -import { - MoveEffectPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Hard Press", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/hyper_beam.test.ts b/src/test/moves/hyper_beam.test.ts index 623b24dbb3c..e7d3454ba32 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -4,10 +4,10 @@ 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 GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; // 20 sec timeout for all tests diff --git a/src/test/moves/light_screen.test.ts b/src/test/moves/light_screen.test.ts index 52c1b85fa7a..e47b6fe93ea 100644 --- a/src/test/moves/light_screen.test.ts +++ b/src/test/moves/light_screen.test.ts @@ -3,11 +3,9 @@ import Move, { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import Pokemon from "#app/field/pokemon.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { NumberHolder } from "#app/utils.js"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/magnet_rise.test.ts b/src/test/moves/magnet_rise.test.ts index e5dfb94468e..9b3c6c457e2 100644 --- a/src/test/moves/magnet_rise.test.ts +++ b/src/test/moves/magnet_rise.test.ts @@ -1,5 +1,5 @@ import { CommandPhase, TurnEndPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/make_it_rain.test.ts b/src/test/moves/make_it_rain.test.ts index fcfb1daa2cf..850f8f644b8 100644 --- a/src/test/moves/make_it_rain.test.ts +++ b/src/test/moves/make_it_rain.test.ts @@ -1,17 +1,13 @@ import { BattleStat } from "#app/data/battle-stat.js"; -import { - MoveEffectPhase, - MoveEndPhase, - StatChangePhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEffectPhase, MoveEndPhase, StatChangePhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; diff --git a/src/test/moves/multi_target.test.ts b/src/test/moves/multi_target.test.ts index b7c4303afb3..a4ed936c5ee 100644 --- a/src/test/moves/multi_target.test.ts +++ b/src/test/moves/multi_target.test.ts @@ -2,12 +2,12 @@ import { getMoveTargets } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { Species } from "#app/enums/species.js"; import { TurnEndPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import { Moves } from "#enums/moves"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -73,7 +73,6 @@ async function checkTargetMultiplier(game: GameManager, attackMove: Moves, killA await game.startBattle(); const playerPokemonRepr = game.scene.getPlayerField(); - expect(playerPokemonRepr).not.toBeUndefined(); killAllyAndEnemy(game, killAlly, killSecondEnemy); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index 1e19a3dc1c2..8988109f431 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -1,14 +1,14 @@ import { BattleStat } from "#app/data/battle-stat"; import { TrappedTag } from "#app/data/battler-tags.js"; import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Octolock", () => { describe("integration tests", () => { diff --git a/src/test/moves/purify.test.ts b/src/test/moves/purify.test.ts index cbc107a3def..4d108c43d4b 100644 --- a/src/test/moves/purify.test.ts +++ b/src/test/moves/purify.test.ts @@ -1,10 +1,8 @@ import { Status, StatusEffect } from "#app/data/status-effect.js"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon.js"; -import { - MoveEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { MoveEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/rage_powder.test.ts b/src/test/moves/rage_powder.test.ts index bc533e1313e..92cdcc9b4f7 100644 --- a/src/test/moves/rage_powder.test.ts +++ b/src/test/moves/rage_powder.test.ts @@ -1,11 +1,7 @@ import { BattlerIndex } from "#app/battle.js"; -import { - CommandPhase, - SelectTargetPhase, - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/reflect.test.ts b/src/test/moves/reflect.test.ts index 6fcd2268d12..821d9df437a 100644 --- a/src/test/moves/reflect.test.ts +++ b/src/test/moves/reflect.test.ts @@ -3,11 +3,9 @@ import Move, { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import Pokemon from "#app/field/pokemon.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { NumberHolder } from "#app/utils.js"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/rollout.test.ts b/src/test/moves/rollout.test.ts index 73457c9dcce..ad323c447f5 100644 --- a/src/test/moves/rollout.test.ts +++ b/src/test/moves/rollout.test.ts @@ -1,13 +1,13 @@ import { allMoves } from "#app/data/move.js"; import { CommandPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Rollout", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/roost.test.ts b/src/test/moves/roost.test.ts index fe89a0a0a10..9ebd52e457d 100644 --- a/src/test/moves/roost.test.ts +++ b/src/test/moves/roost.test.ts @@ -3,10 +3,10 @@ import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { Moves } from "#app/enums/moves.js"; import { Species } from "#app/enums/species.js"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; const TIMEOUT = 20 * 1000; @@ -40,11 +40,7 @@ describe("Moves - Roost", () => { async () => { await game.startBattle([Species.MAGIKARP]); - const leadPokemon = game.scene.getPlayerPokemon(); - expect(leadPokemon).toBeDefined(); - const enemyPokemon = game.scene.getEnemyPokemon(); - expect(enemyPokemon).toBeDefined(); const enemyStartingHp = enemyPokemon.hp; diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index a19c28b2c1e..1f5bb757ee4 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -1,7 +1,5 @@ -import { - CommandPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import { CommandPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index 0fc01821838..298c96d6d66 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -4,13 +4,13 @@ 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 GameManager from "#test/utils/gameManager"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Spit Up", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/spotlight.test.ts b/src/test/moves/spotlight.test.ts index 8170c42dfec..0893ba975d7 100644 --- a/src/test/moves/spotlight.test.ts +++ b/src/test/moves/spotlight.test.ts @@ -1,12 +1,8 @@ import { BattlerIndex } from "#app/battle.js"; import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - SelectTargetPhase, - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index 81bd65ce582..604b08745eb 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -2,14 +2,14 @@ import { BattleStat } from "#app/data/battle-stat"; import { StockpilingTag } from "#app/data/battler-tags.js"; import { MoveResult, TurnMove } from "#app/field/pokemon.js"; import { CommandPhase, TurnInitPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Stockpile", () => { describe("integration tests", () => { diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 7c3d3ae1613..9a0a19dce2b 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -3,13 +3,13 @@ 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 GameManager from "#test/utils/gameManager"; 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, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Swallow", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index 94eee4f20fa..512b23ae363 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -1,10 +1,7 @@ import { Stat } from "#app/data/pokemon-stat"; -import { - CommandPhase, - EnemyCommandPhase, TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, EnemyCommandPhase, TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Moves } from "#enums/moves"; diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 539829f4003..7630b31f7de 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -1,11 +1,7 @@ import { BattleStat } from "#app/data/battle-stat"; -import { - CommandPhase, - EnemyCommandPhase, - TurnInitPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { CommandPhase, EnemyCommandPhase, TurnInitPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/moves/tailwind.test.ts b/src/test/moves/tailwind.test.ts index d2a90dd2ed5..d88de680d8a 100644 --- a/src/test/moves/tailwind.test.ts +++ b/src/test/moves/tailwind.test.ts @@ -1,16 +1,14 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; import { Stat } from "#app/data/pokemon-stat.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; -import { - TurnEndPhase, -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { TurnEndPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Wind Rider", () => { let phaserGame: Phaser.Game; diff --git a/src/test/moves/thousand_arrows.test.ts b/src/test/moves/thousand_arrows.test.ts index a7fbee3bebd..3b15610f896 100644 --- a/src/test/moves/thousand_arrows.test.ts +++ b/src/test/moves/thousand_arrows.test.ts @@ -1,11 +1,8 @@ import { Abilities } from "#app/enums/abilities.js"; import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { - BerryPhase, - MoveEffectPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { BerryPhase, MoveEffectPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index b1292de0d27..83e1dda07cb 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -1,14 +1,14 @@ import { BattleStat } from "#app/data/battle-stat.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { MoveEndPhase, TurnEndPhase } from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; 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, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Moves - Tidy Up", () => { diff --git a/src/test/phases/phases.test.ts b/src/test/phases/phases.test.ts index 3d6da362004..c61eb1d41b8 100644 --- a/src/test/phases/phases.test.ts +++ b/src/test/phases/phases.test.ts @@ -1,9 +1,9 @@ import BattleScene from "#app/battle-scene.js"; import { LoginPhase, TitlePhase, UnavailablePhase } from "#app/phases.js"; import { Mode } from "#app/ui/ui.js"; -import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; +import GameManager from "#test/utils/gameManager"; describe("Phases", () => { let phaserGame: Phaser.Game; diff --git a/src/test/settingMenu/helpers/inGameManip.ts b/src/test/settingMenu/helpers/inGameManip.ts index 1edab75fd27..e18a82ca571 100644 --- a/src/test/settingMenu/helpers/inGameManip.ts +++ b/src/test/settingMenu/helpers/inGameManip.ts @@ -1,9 +1,6 @@ -import { - getIconForLatestInput, - getSettingNameWithKeycode -} from "#app/configs/inputs/configHandler"; -import {expect} from "vitest"; -import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; +import { getIconForLatestInput, getSettingNameWithKeycode } from "#app/configs/inputs/configHandler"; +import { expect } from "vitest"; +import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; export class InGameManip { private config; diff --git a/src/test/settingMenu/helpers/menuManip.ts b/src/test/settingMenu/helpers/menuManip.ts index 7b4080c3d75..f33867476cf 100644 --- a/src/test/settingMenu/helpers/menuManip.ts +++ b/src/test/settingMenu/helpers/menuManip.ts @@ -1,14 +1,6 @@ -import {expect} from "vitest"; -import { - deleteBind, - getIconWithKeycode, - getIconWithSettingName, - getKeyWithKeycode, - getKeyWithSettingName, - assign, - getSettingNameWithKeycode, canIAssignThisKey, canIDeleteThisKey, canIOverrideThisSetting -} from "#app/configs/inputs/configHandler"; -import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; +import { expect } from "vitest"; +import { deleteBind, getIconWithKeycode, getIconWithSettingName, getKeyWithKeycode, getKeyWithSettingName, assign, getSettingNameWithKeycode, canIAssignThisKey, canIDeleteThisKey, canIOverrideThisSetting } from "#app/configs/inputs/configHandler"; +import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; export class MenuManip { private config; diff --git a/src/test/settingMenu/rebinding_setting.test.ts b/src/test/settingMenu/rebinding_setting.test.ts index 010ad427d6e..3bc17109c95 100644 --- a/src/test/settingMenu/rebinding_setting.test.ts +++ b/src/test/settingMenu/rebinding_setting.test.ts @@ -1,14 +1,11 @@ -import {beforeEach, describe, expect, it} from "vitest"; -import {deepCopy} from "#app/utils"; -import { - getKeyWithKeycode, - getKeyWithSettingName, -} from "#app/configs/inputs/configHandler"; -import {MenuManip} from "#app/test/settingMenu/helpers/menuManip"; -import {InGameManip} from "#app/test/settingMenu/helpers/inGameManip"; -import {InterfaceConfig} from "#app/inputs-controller"; +import { beforeEach, describe, expect, it } from "vitest"; +import { deepCopy } from "#app/utils"; +import { getKeyWithKeycode, getKeyWithSettingName } from "#app/configs/inputs/configHandler"; +import { MenuManip } from "#test/settingMenu/helpers/menuManip"; +import { InGameManip } from "#test/settingMenu/helpers/inGameManip"; +import { InterfaceConfig } from "#app/inputs-controller"; import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; -import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; +import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; import { Device } from "#enums/devices"; import { Button } from "#enums/buttons"; diff --git a/src/test/sprites/pokemonSprite.test.ts b/src/test/sprites/pokemonSprite.test.ts index 0fd725b2f58..ce847751b6b 100644 --- a/src/test/sprites/pokemonSprite.test.ts +++ b/src/test/sprites/pokemonSprite.test.ts @@ -2,7 +2,7 @@ import { beforeAll, describe, expect, it } from "vitest"; import _masterlist from "../../../public/images/pokemon/variant/_masterlist.json"; import fs from "fs"; import path from "path"; -import { getAppRootDir } from "#app/test/sprites/spritesUtils"; +import { getAppRootDir } from "#test/sprites/spritesUtils"; type PokemonVariantMasterlist = typeof _masterlist; @@ -29,10 +29,10 @@ describe("check if every variant's sprite are correctly set", () => { }); it("data should not be undefined", () => { - expect(masterlist).not.toBeUndefined(); - expect(expVariant).not.toBeUndefined(); - expect(femaleVariant).not.toBeUndefined(); - expect(backVariant).not.toBeUndefined(); + expect(masterlist).toBeDefined(); + expect(expVariant).toBeDefined(); + expect(femaleVariant).toBeDefined(); + expect(backVariant).toBeDefined(); }); function getMissingMasterlist(mlist: any, dirpath: string, excludes: string[] = []): string[] { diff --git a/src/test/ui/starter-select.test.ts b/src/test/ui/starter-select.test.ts index 95a4605fd68..eae5b3fe3a5 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -1,20 +1,16 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import { - EncounterPhase, - SelectStarterPhase, - TitlePhase, -} from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {GameModes} from "#app/game-mode"; +import GameManager from "#test/utils/gameManager"; +import { EncounterPhase, SelectStarterPhase, TitlePhase } from "#app/phases"; +import { Mode } from "#app/ui/ui"; +import { GameModes } from "#app/game-mode"; import StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; import OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; import SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; -import {OptionSelectItem} from "#app/ui/abstact-option-select-ui-handler"; -import {Gender} from "#app/data/gender"; -import {allSpecies} from "#app/data/pokemon-species"; -import {Nature} from "#app/data/nature"; +import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; +import { Gender } from "#app/data/gender"; +import { allSpecies } from "#app/data/pokemon-species"; +import { Nature} from "#app/data/nature"; import { Button } from "#enums/buttons"; import { Abilities } from "#enums/abilities"; import { Species } from "#enums/species"; diff --git a/src/test/ui/transfer-item.test.ts b/src/test/ui/transfer-item.test.ts index c00e40b8ebd..bbb9a823ad9 100644 --- a/src/test/ui/transfer-item.test.ts +++ b/src/test/ui/transfer-item.test.ts @@ -2,18 +2,15 @@ import { BerryType } from "#app/enums/berry-type"; import { Button } from "#app/enums/buttons"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { - BattleEndPhase, - SelectModifierPhase -} from "#app/phases"; -import GameManager from "#app/test/utils/gameManager"; +import { BattleEndPhase, SelectModifierPhase } from "#app/phases"; +import GameManager from "#test/utils/gameManager"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; import { Mode } from "#app/ui/ui"; import Phaser from "phaser"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { getMovePosition } from "../utils/gameManagerUtils"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; describe("UI - Transfer Items", () => { diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 1bab99db83d..ac7f7aea4d2 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -1,18 +1,18 @@ -import GameWrapper from "#app/test/utils/gameWrapper"; +import GameWrapper from "#test/utils/gameWrapper"; import { Mode } from "#app/ui/ui"; -import { generateStarter, waitUntil } from "#app/test/utils/gameManagerUtils"; +import { generateStarter, waitUntil } from "#test/utils/gameManagerUtils"; import { CommandPhase, EncounterPhase, FaintPhase, LoginPhase, NewBattlePhase, SelectStarterPhase, SelectTargetPhase, TitlePhase, TurnEndPhase, TurnInitPhase, TurnStartPhase } from "#app/phases"; import BattleScene from "#app/battle-scene.js"; -import PhaseInterceptor from "#app/test/utils/phaseInterceptor"; -import TextInterceptor from "#app/test/utils/TextInterceptor"; +import PhaseInterceptor from "#test/utils/phaseInterceptor"; +import TextInterceptor from "#test/utils/TextInterceptor"; import { GameModes, getGameMode } from "#app/game-mode"; import fs from "fs"; import { AES, enc } from "crypto-js"; import { updateUserInfo } from "#app/account"; -import InputsHandler from "#app/test/utils/inputsHandler"; -import ErrorInterceptor from "#app/test/utils/errorInterceptor"; +import InputsHandler from "#test/utils/inputsHandler"; +import ErrorInterceptor from "#test/utils/errorInterceptor"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import { MockClock } from "#app/test/utils/mocks/mockClock"; +import { MockClock } from "#test/utils/mocks/mockClock"; import { Command } from "#app/ui/command-ui-handler"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; diff --git a/src/test/utils/gameWrapper.ts b/src/test/utils/gameWrapper.ts index de32215fabb..7edb69aef8a 100644 --- a/src/test/utils/gameWrapper.ts +++ b/src/test/utils/gameWrapper.ts @@ -8,23 +8,23 @@ import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin; import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin; import EventEmitter = Phaser.Events.EventEmitter; import UpdateList = Phaser.GameObjects.UpdateList; -import MockGraphics from "#app/test/utils/mocks/mocksContainer/mockGraphics"; -import MockTextureManager from "#app/test/utils/mocks/mockTextureManager"; +import MockGraphics from "#test/utils/mocks/mocksContainer/mockGraphics"; +import MockTextureManager from "#test/utils/mocks/mockTextureManager"; import Phaser from "phaser"; -import {blobToString} from "#app/test/utils/gameManagerUtils"; -import {vi} from "vitest"; -import mockLocalStorage from "#app/test/utils/mocks/mockLocalStorage"; -import mockConsoleLog from "#app/test/utils/mocks/mockConsoleLog"; -import MockLoader from "#app/test/utils/mocks/mockLoader"; -import {MockFetch} from "#app/test/utils/mocks/mockFetch"; +import { blobToString } from "#test/utils/gameManagerUtils"; +import { vi } from "vitest"; +import mockLocalStorage from "#test/utils/mocks/mockLocalStorage"; +import mockConsoleLog from "#test/utils/mocks/mockConsoleLog"; +import MockLoader from "#test/utils/mocks/mockLoader"; +import { MockFetch } from "#test/utils/mocks/mockFetch"; import * as Utils from "#app/utils"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; -import {MockClock} from "#app/test/utils/mocks/mockClock"; +import { MockClock } from "#test/utils/mocks/mockClock"; import BattleScene from "#app/battle-scene.js"; -import {MoveAnim} from "#app/data/battle-anims"; +import { MoveAnim } from "#app/data/battle-anims"; import Pokemon from "#app/field/pokemon"; import * as battleScene from "#app/battle-scene"; -import MockImage from "#app/test/utils/mocks/mocksContainer/mockImage.js"; +import MockImage from "#test/utils/mocks/mocksContainer/mockImage.js"; import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator"; Object.defineProperty(window, "localStorage", { @@ -41,7 +41,7 @@ Phaser.GameObjects.Image = MockImage; window.URL.createObjectURL = (blob: Blob) => { blobToString(blob).then((data: string) => { localStorage.setItem("toExport", data); - }) + }); return null; }; navigator.getGamepads = vi.fn().mockReturnValue([]); @@ -101,7 +101,7 @@ export default class GameWrapper { injectMandatory() { this.game.config = { seed: ["test"], - } + }; this.scene.game = this.game; this.game.renderer = { maxTextures: -1, @@ -139,7 +139,7 @@ export default class GameWrapper { setPostPipeline: () => null, removePostPipeline: () => null, }, - } + }; this.scene.tweens = { add: (data) => { @@ -254,4 +254,4 @@ function createFetchBadResponse(data) { json: () => Promise.resolve(data), text: () => Promise.resolve(JSON.stringify(data)), }; -} \ No newline at end of file +} diff --git a/src/test/utils/inputsHandler.ts b/src/test/utils/inputsHandler.ts index 043dcffbdb9..e41667dc873 100644 --- a/src/test/utils/inputsHandler.ts +++ b/src/test/utils/inputsHandler.ts @@ -1,8 +1,8 @@ import BattleScene from "#app/battle-scene"; import Phaser from "phaser"; -import {InputsController} from "#app/inputs-controller"; +import { InputsController } from "#app/inputs-controller"; import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; -import {holdOn} from "#app/test/utils/gameManagerUtils"; +import { holdOn } from "#test/utils/gameManagerUtils"; import TouchControl from "#app/touch-controls"; import { JSDOM } from "jsdom"; import fs from "fs"; diff --git a/src/test/utils/misc.test.ts b/src/test/utils/misc.test.ts index da67fb48192..c1947dbe8a2 100644 --- a/src/test/utils/misc.test.ts +++ b/src/test/utils/misc.test.ts @@ -1,8 +1,8 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import Phaser from "phaser"; -import GameManager from "#app/test/utils/gameManager"; -import {apiFetch} from "#app/utils"; -import {waitUntil} from "#app/test/utils/gameManagerUtils"; +import GameManager from "#test/utils/gameManager"; +import { apiFetch } from "#app/utils"; +import { waitUntil } from "#test/utils/gameManagerUtils"; describe("Test misc", () => { let phaserGame: Phaser.Game; @@ -59,7 +59,7 @@ describe("Test misc", () => { it("test apifetch mock sync", async () => { const data = await game.scene.cachedFetch("./battle-anims/splishy-splash.json"); - expect(data).not.toBeUndefined(); + expect(data).toBeDefined(); }); it("testing wait phase queue", async () => { diff --git a/src/test/utils/mocks/mockTextureManager.ts b/src/test/utils/mocks/mockTextureManager.ts index e207f96b722..36a09efcf5a 100644 --- a/src/test/utils/mocks/mockTextureManager.ts +++ b/src/test/utils/mocks/mockTextureManager.ts @@ -1,10 +1,10 @@ -import MockContainer from "#app/test/utils/mocks/mocksContainer/mockContainer"; -import MockSprite from "#app/test/utils/mocks/mocksContainer/mockSprite"; -import MockRectangle from "#app/test/utils/mocks/mocksContainer/mockRectangle"; -import MockNineslice from "#app/test/utils/mocks/mocksContainer/mockNineslice"; -import MockImage from "#app/test/utils/mocks/mocksContainer/mockImage"; -import MockText from "#app/test/utils/mocks/mocksContainer/mockText"; -import MockPolygon from "#app/test/utils/mocks/mocksContainer/mockPolygon"; +import MockContainer from "#test/utils/mocks/mocksContainer/mockContainer"; +import MockSprite from "#test/utils/mocks/mocksContainer/mockSprite"; +import MockRectangle from "#test/utils/mocks/mocksContainer/mockRectangle"; +import MockNineslice from "#test/utils/mocks/mocksContainer/mockNineslice"; +import MockImage from "#test/utils/mocks/mocksContainer/mockImage"; +import MockText from "#test/utils/mocks/mocksContainer/mockText"; +import MockPolygon from "#test/utils/mocks/mocksContainer/mockPolygon"; export default class MockTextureManager { diff --git a/src/test/utils/mocks/mocksContainer/mockContainer.ts b/src/test/utils/mocks/mocksContainer/mockContainer.ts index 2e2b9567796..b74c46b4e86 100644 --- a/src/test/utils/mocks/mocksContainer/mockContainer.ts +++ b/src/test/utils/mocks/mocksContainer/mockContainer.ts @@ -1,4 +1,4 @@ -import MockTextureManager from "#app/test/utils/mocks/mockTextureManager"; +import MockTextureManager from "#test/utils/mocks/mockTextureManager"; export default class MockContainer { protected x; diff --git a/src/test/utils/mocks/mocksContainer/mockImage.ts b/src/test/utils/mocks/mocksContainer/mockImage.ts index 601dfd22811..be183a0dd89 100644 --- a/src/test/utils/mocks/mocksContainer/mockImage.ts +++ b/src/test/utils/mocks/mocksContainer/mockImage.ts @@ -1,4 +1,4 @@ -import MockContainer from "#app/test/utils/mocks/mocksContainer/mockContainer"; +import MockContainer from "#test/utils/mocks/mocksContainer/mockContainer"; export default class MockImage extends MockContainer { diff --git a/src/test/utils/mocks/mocksContainer/mockNineslice.ts b/src/test/utils/mocks/mocksContainer/mockNineslice.ts index 3edbbb18c31..a8e10036a72 100644 --- a/src/test/utils/mocks/mocksContainer/mockNineslice.ts +++ b/src/test/utils/mocks/mocksContainer/mockNineslice.ts @@ -1,4 +1,4 @@ -import MockContainer from "#app/test/utils/mocks/mocksContainer/mockContainer"; +import MockContainer from "#test/utils/mocks/mocksContainer/mockContainer"; export default class MockNineslice extends MockContainer { diff --git a/src/test/utils/mocks/mocksContainer/mockPolygon.ts b/src/test/utils/mocks/mocksContainer/mockPolygon.ts index cf448883ce0..12b60904a96 100644 --- a/src/test/utils/mocks/mocksContainer/mockPolygon.ts +++ b/src/test/utils/mocks/mocksContainer/mockPolygon.ts @@ -1,4 +1,4 @@ -import MockContainer from "#app/test/utils/mocks/mocksContainer/mockContainer"; +import MockContainer from "#test/utils/mocks/mocksContainer/mockContainer"; export default class MockPolygon extends MockContainer { diff --git a/src/test/utils/overridesHelper.ts b/src/test/utils/overridesHelper.ts index 2858076e3b6..e51928cc784 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -124,6 +124,17 @@ export class OverridesHelper { return this; } + /** + * Override the player (pokemon) {@linkcode StatusEffect | status-effect} + * @param statusEffect the {@linkcode StatusEffect | status-effect} to set + * @returns + */ + statusEffect(statusEffect: StatusEffect): this { + vi.spyOn(Overrides, "STATUS_OVERRIDE", "get").mockReturnValue(statusEffect); + this.log(`Player Pokemon status-effect set to ${StatusEffect[statusEffect]} (=${statusEffect})!`); + return this; + } + /** * Override each wave to not have standard trainer battles * @returns this diff --git a/src/test/utils/phaseInterceptor.ts b/src/test/utils/phaseInterceptor.ts index e8cec7c9989..383624bf298 100644 --- a/src/test/utils/phaseInterceptor.ts +++ b/src/test/utils/phaseInterceptor.ts @@ -34,10 +34,10 @@ import { UnavailablePhase, VictoryPhase } from "#app/phases"; -import UI, {Mode} from "#app/ui/ui"; -import {Phase} from "#app/phase"; +import UI, { Mode } from "#app/ui/ui"; +import { Phase } from "#app/phase"; import ErrorInterceptor from "#app/test/utils/errorInterceptor"; -import {QuietFormChangePhase} from "#app/form-change-phase"; +import { QuietFormChangePhase } from "#app/form-change-phase"; export default class PhaseInterceptor { public scene; diff --git a/src/test/vitest.setup.ts b/src/test/vitest.setup.ts index 7cddf4bf3b7..b2861b7071c 100644 --- a/src/test/vitest.setup.ts +++ b/src/test/vitest.setup.ts @@ -1,4 +1,4 @@ -import "#app/test/fontFace.setup"; +import "#test/fontFace.setup"; import "vitest-canvas-mock"; import { initLoggedInUser } from "#app/account";