mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 16:56:11 +00:00
587360c8da
* [Bug] Fix eggs having exploitable RNG * Fix Wind Rider test having random chance to fail * Revert egg's ID back to its own unseeded generation * Remove change from wind rider test --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
36 lines
893 B
TypeScript
36 lines
893 B
TypeScript
import { LoadingScene } from "#app/loading-scene";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
import GameManager from "./utils/gameManager";
|
|
|
|
describe("BattleScene", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
it("should remove LoadingScene on create", () => {
|
|
// `BattleScene.create()` is called during the `new GameManager()` call
|
|
expect(game.scene.scene.remove).toHaveBeenCalledWith(LoadingScene.KEY);
|
|
});
|
|
|
|
it("should also reset RNG on reset", () => {
|
|
vi.spyOn(game.scene, "resetSeed");
|
|
|
|
game.scene.reset();
|
|
|
|
expect(game.scene.resetSeed).toHaveBeenCalled();
|
|
});
|
|
});
|