From dd1eecdfa0bce94af9e38f2cdd954abfe0dd9776 Mon Sep 17 00:00:00 2001 From: Nick Szaunig Date: Thu, 15 Oct 2026 16:20:40 +0200 Subject: [PATCH] fix: skip backend fixture comparison when the frontend builds alone The frontend image build only sees ApiCore-Frontend, so reading ../ApiCore-Backend/test/fixtures/placeholder-keys.json failed with ENOENT in CI. Same pattern as the labels and bulk specs: compare in the monorepo checkout, skip inside the image build. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../label-templates/placeholder-keys.spec.ts | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts b/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts index e0fe0ad..a4b6751 100644 --- a/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts +++ b/ApiCore-Frontend/src/lib/label-templates/placeholder-keys.spec.ts @@ -1,19 +1,25 @@ -import { readFileSync } from "node:fs"; +import { existsSync, readFileSync } from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { PLACEHOLDER_KEYS, PLACEHOLDER_LABELS } from "./placeholder-keys"; -describe("placeholder keys", () => { - it("the frontend list equals the backend fixture ApiCore-Backend/test/fixtures/placeholder-keys.json", () => { - // The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend. - const fixture = path.resolve( - process.cwd(), - "../ApiCore-Backend/test/fixtures/placeholder-keys.json", - ); - const backendKeys: unknown = JSON.parse(readFileSync(fixture, "utf8")); +// The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend. +// The frontend image build only sees ApiCore-Frontend, so the comparison runs +// in the monorepo checkout (local gates) and is skipped inside that build. +const fixture = path.resolve( + process.cwd(), + "../ApiCore-Backend/test/fixtures/placeholder-keys.json", +); - expect([...PLACEHOLDER_KEYS]).toEqual(backendKeys); - }); +describe("placeholder keys", () => { + it.skipIf(!existsSync(fixture))( + "the frontend list equals the backend fixture ApiCore-Backend/test/fixtures/placeholder-keys.json", + () => { + const backendKeys: unknown = JSON.parse(readFileSync(fixture, "utf8")); + + expect([...PLACEHOLDER_KEYS]).toEqual(backendKeys); + }, + ); it("has a German label for every key", () => { for (const key of PLACEHOLDER_KEYS) {