Added unit test

This commit is contained in:
TaylorLeLievre 2024-09-07 21:57:47 -04:00
parent d63e445b70
commit 4dee409fcc

View File

@ -1,4 +1,6 @@
import { allMoves } from "#app/data/move"; import { allMoves } from "#app/data/move";
import { StatusEffect } from "#app/enums/status-effect.js";
import { TurnEndPhase } from "#app/phases/turn-end-phase.js";
import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { TurnStartPhase } from "#app/phases/turn-start-phase";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -75,4 +77,21 @@ describe("Weather - Strong Winds", () => {
await game.phaseInterceptor.to(TurnStartPhase); await game.phaseInterceptor.to(TurnStartPhase);
expect(enemy.getAttackTypeEffectiveness(allMoves[Moves.ROCK_SLIDE].type, pikachu)).toBe(1); expect(enemy.getAttackTypeEffectiveness(allMoves[Moves.ROCK_SLIDE].type, pikachu)).toBe(1);
}); });
it("weather goes away when last trainer pokemon dies to indirect damage", async () => {
game.override.enemyStatusEffect(StatusEffect.POISON);
await game.startBattle([Species.MAGIKARP]);
const enemy = game.scene.getEnemyPokemon()!;
enemy["hp"] = 0.0001;
game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase);
expect(game.scene.arena.weather?.weatherType).toBeUndefined();
});
}); });