mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-06 18:09:10 +00:00
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
|
import Phaser from "phaser";
|
|
import GameManager from "#app/test/utils/gameManager";
|
|
import * as overrides from "#app/overrides";
|
|
import {Abilities, Species} from "#enums";
|
|
import {
|
|
CommandPhase,
|
|
} from "#app/phases";
|
|
import {BattleStat} from "#app/data/battle-stat";
|
|
|
|
|
|
describe("Abilities - Intrepid Sword", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
|
|
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.ZACIAN);
|
|
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD);
|
|
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD);
|
|
});
|
|
|
|
it("INTREPID SWORD on player", async() => {
|
|
await game.runToSummon([
|
|
Species.ZACIAN,
|
|
]);
|
|
await game.phaseInterceptor.to(CommandPhase, false);
|
|
const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
|
expect(battleStatsPokemon[BattleStat.ATK]).toBe(1);
|
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(1);
|
|
}, 20000);
|
|
});
|