mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Removed cases of expect(xxx === y).toBeTruthy()
just use `expect.toBe()`, it looks better and actually tells you stuff
This commit is contained in:
parent
31f5136ed6
commit
4796852bc3
@ -43,7 +43,7 @@ describe("Moves - Baneful Bunker", () => {
|
||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||
await game.phaseInterceptor.to("BerryPhase", false);
|
||||
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
|
||||
expect(leadPokemon.status?.effect === StatusEffect.POISON).toBeTruthy();
|
||||
expect(leadPokemon.status?.effect).toBe(StatusEffect.POISON);
|
||||
});
|
||||
test("should protect the user and poison attackers that make contact, regardless of accuracy checks", async () => {
|
||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||
@ -58,7 +58,7 @@ describe("Moves - Baneful Bunker", () => {
|
||||
await game.move.forceMiss();
|
||||
await game.phaseInterceptor.to("BerryPhase", false);
|
||||
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
|
||||
expect(leadPokemon.status?.effect === StatusEffect.POISON).toBeTruthy();
|
||||
expect(leadPokemon.status?.effect).toBe(StatusEffect.POISON);
|
||||
});
|
||||
|
||||
test("should not poison attackers that don't make contact", async () => {
|
||||
|
@ -57,8 +57,8 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be normal type, and NOT flying type
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.NORMAL).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.NORMAL);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -66,8 +66,8 @@ describe("Moves - Roost", () => {
|
||||
// Lose HP, still normal type
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBeLessThan(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.NORMAL).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.NORMAL);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
});
|
||||
|
||||
@ -81,7 +81,7 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be normal type, and NOT flying type
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.NORMAL).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.NORMAL);
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeFalsy();
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
@ -91,7 +91,7 @@ describe("Moves - Roost", () => {
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBeLessThan(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.NORMAL).toBeFalsy();
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -105,8 +105,8 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be pure fighting type and grounded
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.FIGHTING).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FIGHTING);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -114,8 +114,8 @@ describe("Moves - Roost", () => {
|
||||
// Should have lost HP and is now back to being fighting/flying
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBeLessThan(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.FIGHTING).toBeTruthy();
|
||||
expect(playerPokemonTypes[1] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FIGHTING);
|
||||
expect(playerPokemonTypes[1]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -130,8 +130,8 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be pure eletric type and grounded
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.ELECTRIC).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.ELECTRIC);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -139,8 +139,8 @@ describe("Moves - Roost", () => {
|
||||
// Should have lost HP and is now back to being electric/flying
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBe(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.ELECTRIC).toBeTruthy();
|
||||
expect(playerPokemonTypes[1] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.ELECTRIC);
|
||||
expect(playerPokemonTypes[1]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -154,8 +154,8 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be pure flying type after burn up
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
game.move.select(Moves.ROOST);
|
||||
@ -165,8 +165,8 @@ describe("Moves - Roost", () => {
|
||||
// Should only be typeless type after roost and is grounded
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.getTag(BattlerTagType.ROOSTED)).toBeDefined();
|
||||
expect(playerPokemonTypes[0] === PokemonType.UNKNOWN).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.UNKNOWN);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -174,8 +174,8 @@ describe("Moves - Roost", () => {
|
||||
// Should go back to being pure flying and have taken damage from earthquake, and is ungrounded again
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBeLessThan(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -190,8 +190,8 @@ describe("Moves - Roost", () => {
|
||||
|
||||
// Should only be pure flying type after burn up
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
game.move.select(Moves.ROOST);
|
||||
@ -201,8 +201,8 @@ describe("Moves - Roost", () => {
|
||||
// Should only be typeless type after roost and is grounded
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.getTag(BattlerTagType.ROOSTED)).toBeDefined();
|
||||
expect(playerPokemonTypes[0] === PokemonType.UNKNOWN).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.UNKNOWN);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -210,8 +210,8 @@ describe("Moves - Roost", () => {
|
||||
// Should go back to being pure flying and have taken damage from earthquake, and is ungrounded again
|
||||
playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemon.hp).toBeLessThan(playerPokemonStartingHP);
|
||||
expect(playerPokemonTypes[0] === PokemonType.FLYING).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FLYING);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -228,8 +228,8 @@ describe("Moves - Roost", () => {
|
||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||
|
||||
let playerPokemonTypes = playerPokemon.getTypes();
|
||||
expect(playerPokemonTypes[0] === PokemonType.FIRE).toBeTruthy();
|
||||
expect(playerPokemonTypes.length === 1).toBeTruthy();
|
||||
expect(playerPokemonTypes[0]).toBe(PokemonType.FIRE);
|
||||
expect(playerPokemonTypes.length).toBe(1);
|
||||
expect(playerPokemon.isGrounded()).toBeTruthy();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
@ -239,7 +239,7 @@ describe("Moves - Roost", () => {
|
||||
expect(playerPokemonTypes.filter(type => type === PokemonType.FLYING)).toHaveLength(1);
|
||||
expect(playerPokemonTypes.filter(type => type === PokemonType.FIRE)).toHaveLength(1);
|
||||
expect(playerPokemonTypes.filter(type => type === PokemonType.GHOST)).toHaveLength(1);
|
||||
expect(playerPokemonTypes.length === 3).toBeTruthy();
|
||||
expect(playerPokemonTypes.length).toBe(3);
|
||||
expect(playerPokemon.isGrounded()).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
@ -137,7 +137,7 @@ describe("A Trainer's Test - Mystery Encounter", () => {
|
||||
expect(eggsAfter).toBeDefined();
|
||||
expect(eggsBeforeLength + 1).toBe(eggsAfter.length);
|
||||
const eggTier = eggsAfter[eggsAfter.length - 1].tier;
|
||||
expect(eggTier === EggTier.EPIC || eggTier === EggTier.LEGENDARY).toBeTruthy();
|
||||
expect(eggTier).toBe(EggTier.EPIC || eggTier === EggTier.LEGENDARY);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user