2026-03-18 12:16:07 -07:00
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
|
import { isUnitConfigTestFile } from "../vitest.unit-paths.mjs";
|
|
|
|
|
|
|
|
|
|
describe("isUnitConfigTestFile", () => {
|
|
|
|
|
it("accepts unit-config src, test, and whitelisted ui tests", () => {
|
|
|
|
|
expect(isUnitConfigTestFile("src/infra/git-commit.test.ts")).toBe(true);
|
|
|
|
|
expect(isUnitConfigTestFile("test/format-error.test.ts")).toBe(true);
|
|
|
|
|
expect(isUnitConfigTestFile("ui/src/ui/views/chat.test.ts")).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("rejects files excluded from the unit config", () => {
|
|
|
|
|
expect(
|
2026-03-20 09:30:16 +01:00
|
|
|
isUnitConfigTestFile(
|
|
|
|
|
"native-plugins/imessage/src/monitor.shutdown.unhandled-rejection.test.ts",
|
|
|
|
|
),
|
2026-03-18 12:16:07 -07:00
|
|
|
).toBe(false);
|
|
|
|
|
expect(isUnitConfigTestFile("src/agents/pi-embedded-runner.test.ts")).toBe(false);
|
|
|
|
|
expect(isUnitConfigTestFile("src/commands/onboard.test.ts")).toBe(false);
|
|
|
|
|
expect(isUnitConfigTestFile("ui/src/ui/views/other.test.ts")).toBe(false);
|
|
|
|
|
expect(isUnitConfigTestFile("src/infra/git-commit.live.test.ts")).toBe(false);
|
|
|
|
|
expect(isUnitConfigTestFile("src/infra/git-commit.e2e.test.ts")).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
});
|