merge: PR #35을 합친 검사 브랜치에 넣는다

This commit is contained in:
DongHyeonka
2026-11-13 07:16:02 +09:00
3 changed files with 59 additions and 8 deletions
+20 -1
View File
@@ -6,6 +6,7 @@ import { describe, expect, it } from "vitest";
import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts";
import {
gatedTestPaths,
gatedTestTargets,
listTestFiles,
parseUngatedTestExclusions,
ungatedTestFailures,
@@ -23,7 +24,7 @@ async function repositoryInputs() {
};
return {
testFiles: await listTestFiles(process.cwd()),
gatedPaths: gatedTestPaths(
gatedPaths: gatedTestTargets(
packageDocument.scripts,
contract.commands.map(({ script }) => script),
(file) => readFileSync(file, "utf8"),
@@ -88,6 +89,24 @@ describe("ungated test files", () => {
]);
});
// 0929/12-06. A `*.spec.ts` under a Vitest path counted as gated, but
// vitest.config.ts includes only `*.test.{ts,tsx}`: nothing ran it.
it("gates a Vitest path's test files only, and a Playwright testDir's specs", async () => {
expect(
ungatedTestFailures({ testFiles: ["tests/unit/probe.spec.ts"], gatedPaths: ["tests/unit"], exclusions: [] }),
).toEqual([
"test file is not run by any CI gate command and is not in config/ci/ungated-tests.json: tests/unit/probe.spec.ts",
]);
const inputs = await repositoryInputs();
expect(inputs.gatedPaths).toContainEqual({ path: "tests/e2e", runner: "playwright" });
expect(inputs.gatedPaths).toContainEqual({ path: "tests/unit", runner: "vitest" });
expect(
ungatedTestFailures({ ...inputs, testFiles: ["tests/unit/probe.spec.ts", "tests/e2e/probe.spec.ts"] }),
).toEqual([
"test file is not run by any CI gate command and is not in config/ci/ungated-tests.json: tests/unit/probe.spec.ts",
]);
});
it("requires a reason for every exclusion", () => {
expect(() =>
parseUngatedTestExclusions({