mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 21:42:20 +02:00
Fixed failing test by not trying to mock rng
This commit is contained in:
parent
68adbcbe83
commit
b550088384
@ -1,4 +1,5 @@
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { PostTurnRestoreBerryAbAttr } from "#app/data/abilities/ability";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier";
|
import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier";
|
||||||
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
||||||
@ -72,14 +73,13 @@ describe("Abilities - Harvest", () => {
|
|||||||
|
|
||||||
it("tracks berries eaten while disabled/not present", async () => {
|
it("tracks berries eaten while disabled/not present", async () => {
|
||||||
// Note: this also checks for harvest not being present as neutralizing gas works by making
|
// Note: this also checks for harvest not being present as neutralizing gas works by making
|
||||||
// the game consider all other pokemon to *not* have any ability.
|
// the game consider all other pokemon to *not* have their respective abilities.
|
||||||
game.override
|
game.override
|
||||||
.startingHeldItems([
|
.startingHeldItems([
|
||||||
{ name: "BERRY", type: BerryType.ENIGMA, count: 2 },
|
{ name: "BERRY", type: BerryType.ENIGMA, count: 2 },
|
||||||
{ name: "BERRY", type: BerryType.LUM, count: 2 },
|
{ name: "BERRY", type: BerryType.LUM, count: 2 },
|
||||||
])
|
])
|
||||||
.enemyAbility(Abilities.NEUTRALIZING_GAS)
|
.enemyAbility(Abilities.NEUTRALIZING_GAS);
|
||||||
.weather(WeatherType.NONE); // clear weather so we can control when harvest rolls succeed
|
|
||||||
await game.classicMode.startBattle([Species.MILOTIC]);
|
await game.classicMode.startBattle([Species.MILOTIC]);
|
||||||
|
|
||||||
const milotic = game.scene.getPlayerPokemon()!;
|
const milotic = game.scene.getPlayerPokemon()!;
|
||||||
@ -100,7 +100,7 @@ describe("Abilities - Harvest", () => {
|
|||||||
await game.forceEnemyMove(Moves.NUZZLE);
|
await game.forceEnemyMove(Moves.NUZZLE);
|
||||||
|
|
||||||
await game.phaseInterceptor.to("TurnEndPhase", false);
|
await game.phaseInterceptor.to("TurnEndPhase", false);
|
||||||
vi.spyOn(Phaser.Math.RND, "realInRange").mockReturnValue(0);
|
vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValue(false);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
expect(milotic.battleData.berriesEaten).toEqual(
|
expect(milotic.battleData.berriesEaten).toEqual(
|
||||||
|
Loading…
Reference in New Issue
Block a user