test: Skalen-Paritätstest liest das Backend-Fixture erst im Test
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) <[email protected]>
This commit is contained in:
1 parent
1763d953b6
commit
994c1f4394
1 file changed
+6
-1
@@ -29,10 +29,15 @@ const GOOD_STORED_END: Record<InspectionScaleField, 1 | 5> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// The frontend image builds without the backend folder: then there is nothing to compare.
|
// 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", () => {
|
describe.skipIf(!existsSync(FIXTURE_PATH))("inspection scales", () => {
|
||||||
const fixture = JSON.parse(readFileSync(FIXTURE_PATH, "utf8")) as ScaleFixture[];
|
|
||||||
|
|
||||||
it("scale directions equal the shared fixture", () => {
|
it("scale directions equal the shared fixture", () => {
|
||||||
|
const fixture = readFixture();
|
||||||
expect(Object.keys(INSPECTION_SCALE_DIRECTIONS).sort()).toEqual(
|
expect(Object.keys(INSPECTION_SCALE_DIRECTIONS).sort()).toEqual(
|
||||||
fixture.map((scale) => scale.field).sort(),
|
fixture.map((scale) => scale.field).sort(),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user