기능 시험 자리인 tests/features 바로 아래에 플랫폼 단위 시험 둘과, 지워진 참조 기능의 상수 이름만 보는 가드가 있다. 둘은 tests/unit으로 옮기고 가드는 지운다. 상수 이름을 바꿔 가드를 살리는 안은 참조 기능이 없는 템플릿에서 볼 대상이 없어 쓰지 않는다. 문서들이 가리키는 tests/features 폴더는 .gitkeep으로 남긴다(없으면 verify:documentation이 실패한다). 게이트 배선 시험은 옮긴 파일의 옛 경로 대신 가짜임이 보이는 probe 경로로 tests/features를 본다. REFERENCE_* 이름 금지는 없어진다. 중앙 파일의 기능 import 가운데 loaded-feature-runtimes와 type-only import는 지운 가드도 막지 않았고 지금도 막는 검사가 없다(별도 제안). 검증: 노트북 test:unit·verify:documentation이 통과한다. test:coverage 에서 tests/features를 빼면 게이트 배선 시험이 실패한다. Refs: REV-FE-0021
12 lines
632 B
TypeScript
12 lines
632 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveProductFeatures, selectCompiledProductFeatures } from "../../src/contracts/product-features.ts";
|
|
describe("product feature membership", () => {
|
|
it("preserves selection semantics", () => {
|
|
const compiled = [{featureId:"reference"},{featureId:"local-draft"}] as const;
|
|
expect(selectCompiledProductFeatures(compiled,"reference").map(x=>x.featureId)).toEqual(["reference"]);
|
|
});
|
|
it("resolves installed state", () => {
|
|
expect(resolveProductFeatures(["reference","local-draft"],["reference"]).map(x=>x.state)).toEqual(["NOT_INSTALLED","ACTIVE"]);
|
|
});
|
|
});
|