test(dev): dev release manifest 테스트가 설치된 기능에 기대지 않는다

문제
dev-release-manifest 테스트의 둘째 경우가 생성 결과를 커밋된 자리표시자와
통째로 비교한다. 템플릿 기능만 있으면 같지만, 기능을 더한 제품이나 생성
기능을 넣은 제거 드릴 fixture에서는 contract set이 달라 실패한다. 깨끗한
clone의 FE-GATE-020(test:sample-removal 안의 test:unit)에서 떨어졌다. 이
리뷰가 여러 번 고친 "템플릿 그대로일 때만 맞는 테스트"와 같은 결함을 새로
만들었다.

고른 방법
- 둘째 경우는 contract set을 뺀 나머지 칸이 자리표시자와 같고, contract
  set이 설치된 기능의 buildContractSet()과 같은지 본다.

검증
- 테스트 2건, eslint, check:types 통과.

Refs: docs/reviews/2026-11-03-maturity-review/README.md 14.6 X2 #3
This commit is contained in:
DongHyeonka
2026-11-05 01:52:53 +09:00
parent 0c9fcbd632
commit 8b382aa64f
+12 -4
View File
@@ -43,14 +43,22 @@ describe("dev release manifest", () => {
expect(written["contractSet"]).toEqual(JSON.parse(JSON.stringify(buildContractSet())));
});
it("matches the committed placeholder while the template's own features are installed", async () => {
it("keeps every other field of the committed placeholder", async () => {
directory = await mkdtemp(path.join(tmpdir(), "dev-release-manifest-"));
const output = path.join(directory, "dev-release-manifest.json");
await writeDevReleaseManifest("public/release-manifest.json", output);
expect(JSON.parse(await readFile(output, "utf8"))).toEqual(
JSON.parse(await readFile("public/release-manifest.json", "utf8")),
);
// Whatever features are installed (a product's, or a drill's generated
// one): only the contract set may differ from the placeholder.
const { contractSet, ...written } = JSON.parse(await readFile(output, "utf8")) as Record<
string,
unknown
>;
const { contractSet: _placeholderSet, ...placeholder } = JSON.parse(
await readFile("public/release-manifest.json", "utf8"),
) as Record<string, unknown>;
expect(written).toEqual(placeholder);
expect(contractSet).toEqual(JSON.parse(JSON.stringify(buildContractSet())));
});
});