Files
clean-architecture-frontend…/tests/features/feature-module.test.ts
T
DongHyeonkaandClaude Opus 5.5 840de45ee7 ci: run every test file in a gate or name why not (12-04, 09-11)
tests/architecture, tests/release, tests/scripts, the top-level
tests/features files and the browser-soak contract now run in
test:coverage (FE-GATE-005); check:adapter-inventory joins FE-GATE-010
and the image resolve-signal type fixture joins FE-GATE-003 (baseline
updated). check:ci fails on a test file no gate command reaches unless
config/ci/ungated-tests.json gives a reason; only the tests/scale suite
is listed, pending 11-03. defineFeatureModule's id mismatch is tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:47:10 +09:00

26 lines
993 B
TypeScript

import { describe, expect, it } from "vitest";
import { defineFeatureModule } from "../../src/features/feature-module.ts";
describe("defineFeatureModule", () => {
it("keeps one stable feature id and freezes the descriptor", () => {
const module = defineFeatureModule({
id: "feature-a",
contracts: { featureId: "feature-a" },
routes: {}, adapters: [], runtimes: [], messages: {}, contractContributions: [],
});
expect(module.id).toBe("feature-a");
expect(Object.isFrozen(module)).toBe(true);
});
// 09-11: the one check defineFeatureModule makes at runtime.
it("rejects a module whose id differs from its contract featureId", () => {
expect(() =>
defineFeatureModule({
id: "feature-a",
contracts: { featureId: "feature-b" },
routes: {}, adapters: [], runtimes: [], messages: {}, contractContributions: [],
}),
).toThrow("Feature module id feature-a does not match contract featureId feature-b");
});
});