diff --git a/tests/unit/feature-scaffold-drill.test.ts b/tests/unit/feature-scaffold-drill.test.ts index 2037ea13..956dd2b5 100644 --- a/tests/unit/feature-scaffold-drill.test.ts +++ b/tests/unit/feature-scaffold-drill.test.ts @@ -31,7 +31,7 @@ describe("feature scaffold drill commands", () => { // test:coverage (tests/unit/removal-drill-test-paths.test.ts). expect(commands.map(({ script }) => script)).toEqual(expect.arrayContaining([ "check:types", "lint", "test:coverage", "build", "check:bundle", - "test:recipes", "check:request-fanout", "build:release-candidate", + "check:request-fanout", "build:release-candidate", ])); for (const reason of Object.values(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS)) { expect(reason.length).toBeGreaterThan(10); diff --git a/tests/unit/removal-drill-test-paths.test.ts b/tests/unit/removal-drill-test-paths.test.ts index 8b3f5188..c10f14be 100644 --- a/tests/unit/removal-drill-test-paths.test.ts +++ b/tests/unit/removal-drill-test-paths.test.ts @@ -24,6 +24,10 @@ const readConfig = (file: string) => readFileSync(file, "utf8"); const pathsOf = (entries: readonly string[]) => gatedTestPaths(scripts, entries, readConfig); const within = (target: string, roots: readonly string[]) => roots.some((root) => target === root || target.startsWith(`${root}/`)); +// A copy that removed the optional recipes has no test:recipes; the drill then +// runs only what the copy's package.json still has (scripts/test-sample-removal.ts). +const outsideCoverage = REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE.filter((script) => + Object.hasOwn(scripts, script)); describe("removal drill test paths", () => { const coverage = pathsOf(["test:coverage"]); @@ -38,12 +42,12 @@ describe("removal drill test paths", () => { }); it("run every test:all path in the feature removal: coverage and what it leaves out", () => { - const run = [...coverage, ...pathsOf(REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE)]; + const run = [...coverage, ...pathsOf(outsideCoverage)]; expect(pathsOf(["test:all"]).filter((target) => !within(target, run))).toEqual([]); }); it("name as outside coverage only suites coverage does not already run", () => { - for (const suite of REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE) { + for (const suite of outsideCoverage) { expect(pathsOf([suite]).some((target) => !within(target, coverage)), suite).toBe(true); } });