mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 05:19:29 +02:00
Updates copycat unit test to use metronome getMoveOverride mock
This commit is contained in:
parent
f6953e6ad7
commit
400cdb3784
@ -1,4 +1,5 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { allMoves, RandomMoveAttr } from "#app/data/move";
|
||||
import { Stat } from "#app/enums/stat";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
@ -12,6 +13,8 @@ describe("Moves - Copycat", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
const randomMoveAttr = allMoves[Moves.METRONOME].getAttrs(RandomMoveAttr)[0];
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
@ -66,7 +69,7 @@ describe("Moves - Copycat", () => {
|
||||
.moveset([ Moves.SPLASH, Moves.METRONOME ])
|
||||
.enemyMoveset(Moves.COPYCAT);
|
||||
await game.classicMode.startBattle();
|
||||
vi.spyOn(game.scene.getPlayerPokemon()!, "randSeedInt").mockReturnValue(Moves.SWORDS_DANCE);
|
||||
vi.spyOn(randomMoveAttr, "getMoveOverride").mockReturnValue(Moves.SWORDS_DANCE);
|
||||
|
||||
game.move.select(Moves.METRONOME);
|
||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); // Player moves first, so enemy can copy Swords Dance
|
||||
|
Loading…
Reference in New Issue
Block a user