Files
clean-architecture-frontend…/tests/unit/feature-removal-argument.test.ts
T
DongHyeonka e3c8db48ae chore(features): 참조 기능과 예제 화면을 지우고 레지스트리를 다시 승인한다
소유자 결정(2026-11-07, design-docs repo-structure/README.md 3.4절)으로
템플릿 샘플을 지운다. 샘플이 맡던 시험 대상은 앞 커밋들이 옮겼다.

참조 기능과 예제 화면, 두 context, 그 시험, e2e 3개, 수동 접근성 기록
7개, 런타임 프로필 키, test:reference-feature(명령, 산출물, 게이트
참조), 커버리지 정책 행을 지웠다. removable-template-features 목록은
비우고 장치는 남겼다: test:sample-removal은 인자가 없으면 목록을
하나씩 지우고, 비면 SKIP을 출력하고 보고서에 건너뛴 사례를 남긴다.
기능 스위치 시험과 홈 시작 링크 스위치 시험은 시험 전용 fixture 기능으로
옮겼다. browser soak은 생성 기능을 넣은 빌드에서 돈다. 문서의 샘플
경로를 고쳤다. 날짜가 붙은 설계·리뷰 기록의 본문은 그대로 두었다.
레지스트리 기준선(update:registry-baseline, OWNER DongHyeonka), CI 계약
기준선과 workflow, 초기 JS 기록(194,354B, 17파일, 첫 기능 6,327B, 기능
539B, context 4B)을 다시 받았다.

위험: 레지스트리 행 삭제는 breaking이다. 샘플을 고쳐 쓰는 다운스트림은
수정/삭제 충돌을 만난다. 성능 lab의 기능 라우트 측정은 템플릿에
공개 기능 라우트가 없어 measured:false다. TEMPLATE_FIXTURE 출처는
플랫폼 코드에 남았다.

검증(desktop): check:types, lint, check:architecture, check:registries,
check:ci, verify:documentation, test:unit, test:component,
test:contract, test:integration, test:recipes, test:coverage(Risk
coverage PASS 378/378, 문턱 68개), test:e2e 183, test:a11y, test:visual,
test:storybook, test:browser-capabilities, test:feature-scaffold PASS(76
checks), test:sample-removal SKIP, build, check:bundle.
2026-11-08 14:07:58 +09:00

48 lines
1.9 KiB
TypeScript

import { spawnSync } from "node:child_process";
import { mkdtemp, readFile, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { REMOVABLE_TEMPLATE_FEATURES } from "../../scripts/lib/removable-template-features.ts";
// 09-07 (D-10). The removal gate takes the feature to remove as an argument
// instead of hard-coding the sample; an id no feature declares stops it before
// any fixture is built.
describe("feature removal argument", () => {
it("refuses a feature id that no installed feature declares", () => {
const run = spawnSync(
process.execPath,
["scripts/test-sample-removal.ts", "--feature=missing-feature"],
{ encoding: "utf8" },
);
expect(run.status).not.toBe(0);
expect(run.stderr).toMatch(
/No installed feature declares FEATURE_MODULE_ID "missing-feature"/u,
);
});
// 2026-11-07. Without --feature (FE-GATE-020) the drill removes the listed
// samples. The template lists none: the run says it skipped, and its report
// counts a skipped case, not a pass.
it("reports the drill as skipped when no sample is listed", async () => {
// A project that lists a sample runs the whole drill in FE-GATE-020.
if (REMOVABLE_TEMPLATE_FEATURES.length > 0) return;
const output = await mkdtemp(path.join(tmpdir(), "sample-removal-skip-"));
try {
const run = spawnSync(process.execPath, [path.resolve("scripts/test-sample-removal.ts")], {
cwd: output,
encoding: "utf8",
});
expect(run.status, run.stderr).toBe(0);
expect(run.stdout).toMatch(/^sample removal: SKIP /mu);
expect(await readFile(path.join(output, "artifacts/tests/sample-removal.xml"), "utf8")).toMatch(
/tests="1" failures="0" skipped="1">.*<skipped /u,
);
} finally {
await rm(output, { recursive: true, force: true });
}
});
});