mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 21:39:28 +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 { BattlerIndex } from "#app/battle";
|
||||||
|
import { allMoves, RandomMoveAttr } from "#app/data/move";
|
||||||
import { Stat } from "#app/enums/stat";
|
import { Stat } from "#app/enums/stat";
|
||||||
import { MoveResult } from "#app/field/pokemon";
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
@ -12,6 +13,8 @@ describe("Moves - Copycat", () => {
|
|||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
|
|
||||||
|
const randomMoveAttr = allMoves[Moves.METRONOME].getAttrs(RandomMoveAttr)[0];
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
type: Phaser.HEADLESS,
|
type: Phaser.HEADLESS,
|
||||||
@ -66,7 +69,7 @@ describe("Moves - Copycat", () => {
|
|||||||
.moveset([ Moves.SPLASH, Moves.METRONOME ])
|
.moveset([ Moves.SPLASH, Moves.METRONOME ])
|
||||||
.enemyMoveset(Moves.COPYCAT);
|
.enemyMoveset(Moves.COPYCAT);
|
||||||
await game.classicMode.startBattle();
|
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);
|
game.move.select(Moves.METRONOME);
|
||||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); // Player moves first, so enemy can copy Swords Dance
|
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); // Player moves first, so enemy can copy Swords Dance
|
||||||
|
Loading…
Reference in New Issue
Block a user