production-derived-test-cases
Keep an independent membership oracle when production collections supply test cases.
Why
A test table copied from the production allowed or supported collection changes together with that collection, so removed members silently remove their test cases.
Fix
Declare a literal expected membership table, assert the production collection equals it, and drive cases from that table. Keep deliberate dynamic sweeps with an explained local suppression.
Examples
import { test, expect } from "vitest";import { SUPPORTED_ROLES } from "./roles.js";test.each(SUPPORTED_ROLES)("%s", (role) => { expect(build(role)).toBeDefined();});import { test, expect } from "vitest";import { SUPPORTED_ROLES } from "./roles.js";test("membership", () => { expect(SUPPORTED_ROLES).toEqual(["reader", "writer"]);});test.each(SUPPORTED_ROLES)("%s", (role) => { expect(build(role)).toBeDefined();});