diff --git a/test/moves/delayed-attack.test.ts b/test/moves/delayed-attack.test.ts index e9192b4c206..db3c8bb17a3 100644 --- a/test/moves/delayed-attack.test.ts +++ b/test/moves/delayed-attack.test.ts @@ -195,10 +195,9 @@ describe("Moves - Delayed Attacks", () => { const MEPs = game.scene.phaseManager["phaseQueue"].findAll("MoveEffectPhase"); expect(MEPs).toHaveLength(4); - expect( - MEPs.map(mep => mep.getPokemon().getBattlerIndex()), - "Delayed Attacks were not queued in correct order!", - ).toEqual(oldOrder); + console.log(`Expected: ${oldOrder.map(o => game.scene.getField()[o].getNameToRender())} +Actual: ${MEPs.map(mep => mep.getPokemon().getNameToRender())}`); + expect(MEPs.map(mep => mep.getPokemon().getBattlerIndex())).toEqual(oldOrder); }); it("should vanish silently if it would otherwise hit the user", async () => { diff --git a/test/moves/destiny-bond.test.ts b/test/moves/destiny-bond.test.ts index c96c4e18f36..bbe0ae2bc37 100644 --- a/test/moves/destiny-bond.test.ts +++ b/test/moves/destiny-bond.test.ts @@ -17,8 +17,6 @@ describe("Moves - Destiny Bond", () => { let game: GameManager; const defaultParty = [SpeciesId.BULBASAUR, SpeciesId.SQUIRTLE]; - const enemyFirst = [BattlerIndex.ENEMY, BattlerIndex.PLAYER] as const; - const playerFirst = [BattlerIndex.PLAYER, BattlerIndex.ENEMY] as const; beforeAll(() => { phaserGame = new Phaser.Game({ @@ -52,7 +50,7 @@ describe("Moves - Destiny Bond", () => { const playerPokemon = game.field.getPlayerPokemon(); game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -70,7 +68,7 @@ describe("Moves - Destiny Bond", () => { // Turn 1: Enemy uses Destiny Bond and doesn't faint game.move.select(MoveId.SPLASH); - await game.setTurnOrder(playerFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); expect(enemyPokemon.isFainted()).toBe(false); @@ -78,7 +76,6 @@ describe("Moves - Destiny Bond", () => { // Turn 2: Player KO's the enemy before the enemy's turn game.move.select(moveToUse); - await game.setTurnOrder(playerFirst); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -96,7 +93,7 @@ describe("Moves - Destiny Bond", () => { // Turn 1: Enemy uses Destiny Bond and doesn't faint game.move.select(MoveId.SPLASH); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); expect(enemyPokemon.isFainted()).toBe(false); @@ -104,7 +101,6 @@ describe("Moves - Destiny Bond", () => { // Turn 2: Enemy should fail Destiny Bond then get KO'd game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -122,7 +118,7 @@ describe("Moves - Destiny Bond", () => { const playerPokemon = game.field.getPlayerPokemon(); game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -140,7 +136,7 @@ describe("Moves - Destiny Bond", () => { // Turn 1: Enemy uses Destiny Bond and doesn't faint game.move.select(MoveId.SPORE); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); expect(enemyPokemon.isFainted()).toBe(false); @@ -149,7 +145,6 @@ describe("Moves - Destiny Bond", () => { // Turn 2: Enemy should skip a turn due to sleep, then get KO'd game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -184,7 +179,7 @@ describe("Moves - Destiny Bond", () => { const playerPokemon = game.field.getPlayerPokemon(); game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true); @@ -238,7 +233,7 @@ describe("Moves - Destiny Bond", () => { const playerPokemon = game.field.getPlayerPokemon(); game.move.select(moveToUse); - await game.setTurnOrder(enemyFirst); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.phaseInterceptor.to("BerryPhase"); expect(enemyPokemon.isFainted()).toBe(true);