mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 22:12:16 +02:00
Fixed tests 0.5
This commit is contained in:
parent
ebf1d1b011
commit
a580b07487
@ -130,7 +130,6 @@ describe("RibbonAchv", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.moveset([]).startingLevel(0).starterSpecies(0).enemyMoveset([]).enemySpecies(0).startingWave(0);
|
||||
scene = game.scene;
|
||||
});
|
||||
|
||||
|
@ -138,7 +138,6 @@ describe("Absolute Avarice - Mystery Encounter", () => {
|
||||
expect(enemyField.length).toBe(1);
|
||||
expect(enemyField[0].species.speciesId).toBe(Species.GREEDENT);
|
||||
const moveset = enemyField[0].moveset.map(m => m.moveId);
|
||||
expect(moveset?.length).toBe(4);
|
||||
expect(moveset).toEqual([Moves.THRASH, Moves.CRUNCH, Moves.BODY_PRESS, Moves.SLACK_OFF]);
|
||||
|
||||
const movePhases = phaseSpy.mock.calls.filter(p => p[0] instanceof MovePhase).map(p => p[0]);
|
||||
|
@ -51,7 +51,9 @@ describe("Mystery Encounter Utils", () => {
|
||||
game.override.seed("random");
|
||||
|
||||
let result = getRandomPlayerPokemon();
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY).seed("random2");
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
|
||||
game.override.seed("random2");
|
||||
|
||||
result = getRandomPlayerPokemon();
|
||||
expect(result.species.speciesId).toBe(Species.ARCEUS);
|
||||
@ -69,7 +71,9 @@ describe("Mystery Encounter Utils", () => {
|
||||
game.override.seed("random");
|
||||
|
||||
let result = getRandomPlayerPokemon();
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY).seed("random2");
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
|
||||
game.override.seed("random2");
|
||||
|
||||
result = getRandomPlayerPokemon();
|
||||
expect(result.species.speciesId).toBe(Species.ARCEUS);
|
||||
@ -86,7 +90,9 @@ describe("Mystery Encounter Utils", () => {
|
||||
game.override.seed("random");
|
||||
|
||||
let result = getRandomPlayerPokemon(true);
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY).seed("random2");
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
|
||||
game.override.seed("random2");
|
||||
|
||||
result = getRandomPlayerPokemon(true);
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
@ -103,7 +109,9 @@ describe("Mystery Encounter Utils", () => {
|
||||
game.override.seed("random");
|
||||
|
||||
let result = getRandomPlayerPokemon(true, false);
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY).seed("random2");
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
|
||||
game.override.seed("random2");
|
||||
|
||||
result = getRandomPlayerPokemon(true, false);
|
||||
expect(result.species.speciesId).toBe(Species.MANAPHY);
|
||||
@ -120,7 +128,9 @@ describe("Mystery Encounter Utils", () => {
|
||||
game.override.seed("random");
|
||||
|
||||
let result = getRandomPlayerPokemon(true, false, true);
|
||||
expect(result.species.speciesId).toBe(Species.ARCEUS).seed("random2");
|
||||
expect(result.species.speciesId).toBe(Species.ARCEUS);
|
||||
|
||||
game.override.seed("random2");
|
||||
|
||||
result = getRandomPlayerPokemon(true, false, true);
|
||||
expect(result.species.speciesId).toBe(Species.ARCEUS);
|
||||
@ -240,6 +250,7 @@ describe("Mystery Encounter Utils", () => {
|
||||
|
||||
it("gets species of specified types", () => {
|
||||
// Only 9 tiers are: Kyogre, Groudon, Rayquaza, Arceus, Zacian, Koraidon, Miraidon, Terapagos
|
||||
// TODO: This has to be changed
|
||||
const result = getRandomSpeciesByStarterCost(9, undefined, [PokemonType.GROUND]);
|
||||
const pokeSpecies = getPokemonSpecies(result);
|
||||
expect(pokeSpecies.speciesId).toBe(Species.GROUDON);
|
||||
|
@ -20,6 +20,7 @@ export class MoveHelper extends GameManagerHelper {
|
||||
/**
|
||||
* Intercepts {@linkcode MoveEffectPhase} and mocks the phase's move's
|
||||
* accuracy to -1, guaranteeing a hit.
|
||||
* @returns A promise that resolves once the next MoveEffectPhase has been reached (not run).
|
||||
*/
|
||||
public async forceHit(): Promise<void> {
|
||||
await this.game.phaseInterceptor.to(MoveEffectPhase, false);
|
||||
@ -30,7 +31,8 @@ export class MoveHelper extends GameManagerHelper {
|
||||
/**
|
||||
* Intercepts {@linkcode MoveEffectPhase} and mocks the phase's move's accuracy
|
||||
* to 0, guaranteeing a miss.
|
||||
* @param firstTargetOnly - Whether the move should force miss on the first target only, in the case of multi-target moves.
|
||||
* @param firstTargetOnly - Whether to only force a miss on the first target hit; default `false`.
|
||||
* @returns A promise that resolves once the next MoveEffectPhase has been reached (not run).
|
||||
*/
|
||||
public async forceMiss(firstTargetOnly = false): Promise<void> {
|
||||
await this.game.phaseInterceptor.to(MoveEffectPhase, false);
|
||||
|
Loading…
Reference in New Issue
Block a user