mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 07:23:24 +02:00
Fixed test stuff
This commit is contained in:
parent
7da255fe57
commit
76beb6c4a1
@ -195,10 +195,9 @@ describe("Moves - Delayed Attacks", () => {
|
|||||||
|
|
||||||
const MEPs = game.scene.phaseManager["phaseQueue"].findAll("MoveEffectPhase");
|
const MEPs = game.scene.phaseManager["phaseQueue"].findAll("MoveEffectPhase");
|
||||||
expect(MEPs).toHaveLength(4);
|
expect(MEPs).toHaveLength(4);
|
||||||
expect(
|
console.log(`Expected: ${oldOrder.map(o => game.scene.getField()[o].getNameToRender())}
|
||||||
MEPs.map(mep => mep.getPokemon().getBattlerIndex()),
|
Actual: ${MEPs.map(mep => mep.getPokemon().getNameToRender())}`);
|
||||||
"Delayed Attacks were not queued in correct order!",
|
expect(MEPs.map(mep => mep.getPokemon().getBattlerIndex())).toEqual(oldOrder);
|
||||||
).toEqual(oldOrder);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should vanish silently if it would otherwise hit the user", async () => {
|
it("should vanish silently if it would otherwise hit the user", async () => {
|
||||||
|
@ -17,8 +17,6 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
|
|
||||||
const defaultParty = [SpeciesId.BULBASAUR, SpeciesId.SQUIRTLE];
|
const defaultParty = [SpeciesId.BULBASAUR, SpeciesId.SQUIRTLE];
|
||||||
const enemyFirst = [BattlerIndex.ENEMY, BattlerIndex.PLAYER] as const;
|
|
||||||
const playerFirst = [BattlerIndex.PLAYER, BattlerIndex.ENEMY] as const;
|
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
@ -52,7 +50,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -70,7 +68,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
||||||
game.move.select(MoveId.SPLASH);
|
game.move.select(MoveId.SPLASH);
|
||||||
await game.setTurnOrder(playerFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(false);
|
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
|
// Turn 2: Player KO's the enemy before the enemy's turn
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(playerFirst);
|
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -96,7 +93,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
||||||
game.move.select(MoveId.SPLASH);
|
game.move.select(MoveId.SPLASH);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(false);
|
expect(enemyPokemon.isFainted()).toBe(false);
|
||||||
@ -104,7 +101,6 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
// Turn 2: Enemy should fail Destiny Bond then get KO'd
|
// Turn 2: Enemy should fail Destiny Bond then get KO'd
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -122,7 +118,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -140,7 +136,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
// Turn 1: Enemy uses Destiny Bond and doesn't faint
|
||||||
game.move.select(MoveId.SPORE);
|
game.move.select(MoveId.SPORE);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(false);
|
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
|
// Turn 2: Enemy should skip a turn due to sleep, then get KO'd
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -184,7 +179,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
@ -238,7 +233,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.setTurnOrder(enemyFirst);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon.isFainted()).toBe(true);
|
expect(enemyPokemon.isFainted()).toBe(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user