diff --git a/src/test/abilities/mycelium_might.test.ts b/src/test/abilities/mycelium_might.test.ts index 9c92ee46bdc..79716250047 100644 --- a/src/test/abilities/mycelium_might.test.ts +++ b/src/test/abilities/mycelium_might.test.ts @@ -46,8 +46,8 @@ describe("Abilities - Mycelium Might", () => { await game.startBattle([ Species.REGIELEKI ]); const enemyPokemon = game.scene.getEnemyPokemon(); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = enemyPokemon.getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = enemyPokemon?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.BABY_DOLL_EYES)); await game.phaseInterceptor.run(EnemyCommandPhase); @@ -68,8 +68,8 @@ describe("Abilities - Mycelium Might", () => { await game.startBattle([ Species.REGIELEKI ]); const enemyPokemon = game.scene.getEnemyPokemon(); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = enemyPokemon.getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = enemyPokemon?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.BABY_DOLL_EYES)); await game.phaseInterceptor.run(EnemyCommandPhase); @@ -88,8 +88,8 @@ describe("Abilities - Mycelium Might", () => { it("Order is established normally if the Pokemon uses a non-status move", async() => { await game.startBattle([ Species.REGIELEKI ]); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = game.scene.getEnemyPokemon()?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.QUICK_ATTACK)); await game.phaseInterceptor.run(EnemyCommandPhase); diff --git a/src/test/abilities/stall.test.ts b/src/test/abilities/stall.test.ts index 270fdacd7cc..0e3c56017a3 100644 --- a/src/test/abilities/stall.test.ts +++ b/src/test/abilities/stall.test.ts @@ -41,8 +41,8 @@ describe("Abilities - Stall", () => { it("Pokemon with Stall should move last in its priority bracket regardless of speed", async() => { await game.startBattle([ Species.SHUCKLE ]); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = game.scene.getEnemyPokemon()?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.QUICK_ATTACK)); await game.phaseInterceptor.run(EnemyCommandPhase); @@ -58,8 +58,8 @@ describe("Abilities - Stall", () => { it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async() => { await game.startBattle([ Species.SHUCKLE ]); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = game.scene.getEnemyPokemon()?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE)); await game.phaseInterceptor.run(EnemyCommandPhase); @@ -76,8 +76,8 @@ describe("Abilities - Stall", () => { game.override.ability(Abilities.STALL); await game.startBattle([ Species.SHUCKLE ]); - const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex(); - const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex(); + const playerPokemonIndex = game.scene.getPlayerPokemon()?.getBattlerIndex(); + const enemyPokemonIndex = game.scene.getEnemyPokemon()?.getBattlerIndex(); game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE)); await game.phaseInterceptor.run(EnemyCommandPhase);