Load the atlas and Pokédex test data only when the suite runs (#66)

describe.skipIf still runs the describe body to collect tests, so the
ROM and PRET reads at describe level failed the synthetic CI job without
a ROM (runs 123–133). The reads now happen in beforeAll, as in the other
ROM suites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kawaandClaude Opus 5.5 committed 2026-10-05 09:53:10 +02:00
1 parent 7afc87d898
commit 0d8ff442ce
2 files changed
+24 -14

No files matched your search

+9 -3
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { beforeAll, describe, expect, it } from "vitest";
import { existsSync, readFileSync } from "node:fs";
import { CrystalAssets } from "../src/game/rom/assets";
import { GameWorld } from "../src/game/world/world";
@@ -22,7 +22,10 @@ const NEW_BARK_TOWN = "24:4",
describe.skipIf(!existsSync(romPath) || !existsSync(`${pret}/data/maps/landmarks.asm`))(
"the atlas data against the pinned PRET source",
() => {
const assets = new CrystalAssets(new Uint8Array(readFileSync(romPath)));
let assets!: CrystalAssets;
beforeAll(() => {
assets = new CrystalAssets(new Uint8Array(readFileSync(romPath)));
});
const read = (path: string) => readFileSync(`${pret}/${path}`, "utf8");
// const_def counts from 0, or from the value given.
const constants = (path: string, prefix: string) => {
@@ -59,7 +62,10 @@ describe.skipIf(!existsSync(romPath) || !existsSync(`${pret}/data/maps/landmarks
);
describe.skipIf(!existsSync(romPath))("the region atlas", () => {
const assets = new CrystalAssets(new Uint8Array(readFileSync(romPath)));
let assets!: CrystalAssets;
beforeAll(() => {
assets = new CrystalAssets(new Uint8Array(readFileSync(romPath)));
});
function fixture(visited: number[]) {
const world = new GameWorld(assets, () => new Date("2026-09-25T12:00:00"), () => 0x42);
world.state.party = [