diff --git a/ApiCore-Frontend/src/lib/inspections/scales.spec.ts b/ApiCore-Frontend/src/lib/inspections/scales.spec.ts index b965b14..d1e9ab3 100644 --- a/ApiCore-Frontend/src/lib/inspections/scales.spec.ts +++ b/ApiCore-Frontend/src/lib/inspections/scales.spec.ts @@ -29,10 +29,15 @@ const GOOD_STORED_END: Record = { }; // The frontend image builds without the backend folder: then there is nothing to compare. +// The callback of a skipped describe still runs while collecting, so the file +// is read lazily inside the tests. +const readFixture = (): ScaleFixture[] => + JSON.parse(readFileSync(FIXTURE_PATH, "utf8")) as ScaleFixture[]; + describe.skipIf(!existsSync(FIXTURE_PATH))("inspection scales", () => { - const fixture = JSON.parse(readFileSync(FIXTURE_PATH, "utf8")) as ScaleFixture[]; it("scale directions equal the shared fixture", () => { + const fixture = readFixture(); expect(Object.keys(INSPECTION_SCALE_DIRECTIONS).sort()).toEqual( fixture.map((scale) => scale.field).sort(), );