From 994c1f43944d3f56c00aa5e3eb555c713445cb5c Mon Sep 17 00:00:00 2001 From: Nick Szaunig Date: Fri, 16 Oct 2026 13:54:12 +0200 Subject: [PATCH] =?UTF-8?q?test:=20Skalen-Parit=C3=A4tstest=20liest=20das?= =?UTF-8?q?=20Backend-Fixture=20erst=20im=20Test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Im Frontend-Image fehlt der Backend-Ordner; describe.skipIf führt den Rumpf beim Sammeln trotzdem aus, das readFileSync dort brach den Build ab (ENOENT). Das Fixture wird jetzt im Test gelesen. Co-Authored-By: Claude Opus 5.5 (1M context) --- ApiCore-Frontend/src/lib/inspections/scales.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(), );