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) <[email protected]>
This commit is contained in:
1 parent
b4746a2b17
commit
dd1eecdfa0
1 file changed
+10
-4
@@ -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.
|
||||
// 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",
|
||||
);
|
||||
|
||||
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) {
|
||||
|
||||
Reference in new issue
Block a user