mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 00:36:25 +00:00
Fix egg tests (memory use: ~2.4G -> ~550M) (#3757)
This commit is contained in:
parent
2df5da2f61
commit
72702abb2f
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
|||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import BattleScene from "../../battle-scene";
|
|
||||||
|
|
||||||
describe("Egg Generation Tests", () => {
|
describe("Egg Generation Tests", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -18,6 +17,7 @@ describe("Egg Generation Tests", () => {
|
|||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
type: Phaser.HEADLESS,
|
type: Phaser.HEADLESS,
|
||||||
});
|
});
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@ -26,12 +26,11 @@ describe("Egg Generation Tests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
game = new GameManager(phaserGame);
|
|
||||||
await game.importData("src/test/utils/saves/everything.prsv");
|
await game.importData("src/test/utils/saves/everything.prsv");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return Arceus for the 10th of June", () => {
|
it("should return Arceus for the 10th of June", () => {
|
||||||
const scene = new BattleScene();
|
const scene = game.scene;
|
||||||
const timestamp = new Date(2024, 5, 10, 15, 0, 0, 0).getTime();
|
const timestamp = new Date(2024, 5, 10, 15, 0, 0, 0).getTime();
|
||||||
const expectedSpecies = Species.ARCEUS;
|
const expectedSpecies = Species.ARCEUS;
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ describe("Egg Generation Tests", () => {
|
|||||||
expect(result).toBe(expectedSpecies);
|
expect(result).toBe(expectedSpecies);
|
||||||
});
|
});
|
||||||
it("should return Arceus for the 10th of July", () => {
|
it("should return Arceus for the 10th of July", () => {
|
||||||
const scene = new BattleScene();
|
const scene = game.scene;
|
||||||
const timestamp = new Date(2024, 6, 10, 15, 0, 0, 0).getTime();
|
const timestamp = new Date(2024, 6, 10, 15, 0, 0, 0).getTime();
|
||||||
const expectedSpecies = Species.ARCEUS;
|
const expectedSpecies = Species.ARCEUS;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user