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
+17
-11
@@ -1,19 +1,25 @@
|
|||||||
import { readFileSync } from "node:fs";
|
import { existsSync, readFileSync } from "node:fs";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { PLACEHOLDER_KEYS, PLACEHOLDER_LABELS } from "./placeholder-keys";
|
import { PLACEHOLDER_KEYS, PLACEHOLDER_LABELS } from "./placeholder-keys";
|
||||||
|
|
||||||
describe("placeholder keys", () => {
|
// The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend.
|
||||||
it("the frontend list equals the backend fixture ApiCore-Backend/test/fixtures/placeholder-keys.json", () => {
|
// The frontend image build only sees ApiCore-Frontend, so the comparison runs
|
||||||
// The monorepo sits next to the frontend; vitest runs from ApiCore-Frontend.
|
// in the monorepo checkout (local gates) and is skipped inside that build.
|
||||||
const fixture = path.resolve(
|
const fixture = path.resolve(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
"../ApiCore-Backend/test/fixtures/placeholder-keys.json",
|
"../ApiCore-Backend/test/fixtures/placeholder-keys.json",
|
||||||
);
|
);
|
||||||
const backendKeys: unknown = JSON.parse(readFileSync(fixture, "utf8"));
|
|
||||||
|
|
||||||
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", () => {
|
it("has a German label for every key", () => {
|
||||||
for (const key of PLACEHOLDER_KEYS) {
|
for (const key of PLACEHOLDER_KEYS) {
|
||||||
|
|||||||
Reference in new issue
Block a user