Fixed remaining tests

This commit is contained in:
Bertie690 2025-06-17 08:34:00 -04:00
parent 3d0c050a5e
commit 79121a8d01
3 changed files with 26 additions and 30 deletions

View File

@ -1,8 +1,6 @@
import { BattlerIndex } from "#enums/battler-index";
import { globalScene } from "#app/global-scene";
import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { AbilityId } from "#enums/ability-id";
import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -24,29 +22,28 @@ describe("Abilities - Mold Breaker", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.moveset([MoveId.SPLASH])
.ability(AbilityId.MOLD_BREAKER)
.battleStyle("single")
.criticalHits(false)
.enemySpecies(SpeciesId.MAGIKARP)
.enemyAbility(AbilityId.BALL_FETCH)
.enemyAbility(AbilityId.STURDY)
.enemyMoveset(MoveId.SPLASH);
});
it("should turn off the ignore abilities arena variable after the user's move", async () => {
game.override
.enemyMoveset(MoveId.SPLASH)
.ability(AbilityId.MOLD_BREAKER)
.moveset([MoveId.ERUPTION])
.startingLevel(100)
.enemyLevel(2);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const enemy = game.scene.getEnemyPokemon()!;
await game.classicMode.startBattle([SpeciesId.PINSIR]);
expect(enemy.isFainted()).toBe(false);
game.move.select(MoveId.SPLASH);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEndPhase", true);
expect(globalScene.arena.ignoreAbilities).toBe(false);
const player = game.field.getPlayerPokemon();
const enemy = game.field.getEnemyPokemon();
game.move.use(MoveId.X_SCISSOR);
await game.phaseInterceptor.to("MoveEffectPhase");
expect(game.scene.arena.ignoreAbilities).toBe(true);
expect(game.scene.arena.ignoringEffectSource).toBe(player.getBattlerIndex());
await game.toEndOfTurn();
expect(game.scene.arena.ignoreAbilities).toBe(false);
expect(enemy.isFainted()).toBe(true);
});
});

View File

@ -58,8 +58,7 @@ describe("Items - Dire Hit", () => {
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
game.move.select(MoveId.SPLASH);
game.move.use(MoveId.SPLASH);
await game.doKillOpponents();
await game.phaseInterceptor.to(BattleEndPhase);

View File

@ -64,13 +64,13 @@ export class MoveHelper extends GameManagerHelper {
const movePosition = this.getMovePosition(pkmIndex, move);
if (movePosition === -1) {
expect.fail(
`MoveHelper.select called with move ${toReadableString(MoveId[move])} not in moveset!
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
Moveset: ${this.game.scene
.getField()
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
Moveset: [${this.game.scene
.getPlayerParty()
[pkmIndex].getMoveset()
.map(pm => toReadableString(MoveId[pm.moveId]))
.join(", ")}`,
.join(", ")}]`,
);
}
@ -108,13 +108,13 @@ export class MoveHelper extends GameManagerHelper {
const movePosition = this.getMovePosition(pkmIndex, move);
if (movePosition === -1) {
expect.fail(
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}'not in moveset!
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
Moveset: ${this.game.scene
.getField()
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
Moveset: [${this.game.scene
.getPlayerParty()
[pkmIndex].getMoveset()
.map(pm => toReadableString(MoveId[pm.moveId]))
.join(", ")}`,
.join(", ")}]`,
);
}