Fix egg tests (memory use: ~2.4G -> ~550M) (#3757)

This commit is contained in:
NightKev 2024-08-25 11:07:06 -07:00 committed by GitHub
parent 2df5da2f61
commit 72702abb2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 34 additions and 35 deletions

View File

@ -8,7 +8,6 @@ import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import BattleScene from "../../battle-scene";
describe("Egg Generation Tests", () => {
let phaserGame: Phaser.Game;
@ -18,6 +17,7 @@ describe("Egg Generation Tests", () => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
game = new GameManager(phaserGame);
});
afterEach(() => {
@ -26,12 +26,11 @@ describe("Egg Generation Tests", () => {
});
beforeEach(async () => {
game = new GameManager(phaserGame);
await game.importData("src/test/utils/saves/everything.prsv");
});
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 expectedSpecies = Species.ARCEUS;
@ -40,7 +39,7 @@ describe("Egg Generation Tests", () => {
expect(result).toBe(expectedSpecies);
});
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 expectedSpecies = Species.ARCEUS;