perf: route contract test targets

This commit is contained in:
Peter Steinberger
2026-04-04 01:57:00 +01:00
parent b04c4e599c
commit fb0ff6896a
2 changed files with 77 additions and 17 deletions

View File

@@ -89,6 +89,41 @@ describe("test-projects args", () => {
]);
});
it("routes top-level repo tests to the contracts config", () => {
expect(buildVitestRunPlans(["test/appcast.test.ts"])).toEqual([
{
config: "vitest.contracts.config.ts",
forwardedArgs: [],
includePatterns: ["test/appcast.test.ts"],
watchMode: false,
},
]);
});
it("routes contract tests to the contracts config", () => {
expect(
buildVitestRunPlans(["src/plugins/contracts/memory-embedding-provider.contract.test.ts"]),
).toEqual([
{
config: "vitest.contracts.config.ts",
forwardedArgs: [],
includePatterns: ["src/plugins/contracts/memory-embedding-provider.contract.test.ts"],
watchMode: false,
},
]);
});
it("routes config baseline integration tests to the contracts config", () => {
expect(buildVitestRunPlans(["src/config/doc-baseline.integration.test.ts"])).toEqual([
{
config: "vitest.contracts.config.ts",
forwardedArgs: [],
includePatterns: ["src/config/doc-baseline.integration.test.ts"],
watchMode: false,
},
]);
});
it("routes command targets to the commands config", () => {
expect(buildVitestRunPlans(["src/commands/status.summary.test.ts"])).toEqual([
{
@@ -157,6 +192,17 @@ describe("test-projects args", () => {
]);
});
it("widens top-level test helpers to sibling repo tests under contracts", () => {
expect(buildVitestRunPlans(["test/helpers/temp-home.ts"])).toEqual([
{
config: "vitest.contracts.config.ts",
forwardedArgs: [],
includePatterns: ["test/helpers/**/*.test.ts"],
watchMode: false,
},
]);
});
it("routes e2e targets straight to the e2e config", () => {
expect(buildVitestRunPlans(["src/commands/models.set.e2e.test.ts"])).toEqual([
{