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>
26 lines
993 B
TypeScript
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");
|
|
});
|
|
});
|