mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 07:23:24 +02:00
* Rename `default.ts` to `default.boilerplate.ts` * Update `test:create` script to look in the correct location * Update `biome.jsonc` to remove explicit boilerplate folder check * Apply Biome
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { AbilityId } from "#enums/ability-id";
|
|
import { BattlerIndex } from "#enums/battler-index";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { MoveResult } from "#enums/move-result";
|
|
import { SpeciesId } from "#enums/species-id";
|
|
import { GameManager } from "#test/test-utils/game-manager";
|
|
import i18next from "i18next";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("{{description}}", () => {
|
|
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
|
|
.ability(AbilityId.BALL_FETCH)
|
|
.battleStyle("single")
|
|
.criticalHits(false)
|
|
.enemySpecies(SpeciesId.MAGIKARP)
|
|
.enemyAbility(AbilityId.BALL_FETCH)
|
|
.enemyMoveset(MoveId.SPLASH)
|
|
.startingLevel(100)
|
|
.enemyLevel(100);
|
|
});
|
|
|
|
// Find more awesome utility functions inside `#test/test-utils`!
|
|
it("should do XYZ", async () => {
|
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
|
|
|
const feebas = game.field.getPlayerPokemon();
|
|
|
|
game.move.use(MoveId.SPLASH);
|
|
await game.move.forceEnemyMove(MoveId.CELEBRATE);
|
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
|
await game.toEndOfTurn();
|
|
|
|
expect(feebas).toHaveUsedMove({ move: MoveId.SPLASH, result: MoveResult.SUCCESS });
|
|
expect(game).toHaveShownMessage(i18next.t("moveTriggers:splash"));
|
|
});
|
|
});
|