mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-06 09:58:10 +00:00
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
|
import Phaser from "phaser";
|
|
import GameManager from "#app/test/utils/gameManager";
|
|
import Overrides from "#app/overrides";
|
|
import {Abilities} from "#enums/abilities";
|
|
import {Species} from "#enums/species";
|
|
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);
|
|
game.override.battleType("single");
|
|
game.override.enemySpecies(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);
|
|
});
|