diff --git a/scripts/test-extension.mjs b/scripts/test-extension.mjs index 6442556c778..5ec70b1976a 100644 --- a/scripts/test-extension.mjs +++ b/scripts/test-extension.mjs @@ -272,10 +272,10 @@ async function run() { } if (plan.testFiles.length === 0) { - console.error( - `No tests found for ${plan.extensionDir}. Run "pnpm test:extension ${plan.extensionId} -- --dry-run" to inspect the resolved roots.`, + console.log( + `[test-extension] No tests found for ${plan.extensionDir}; skipping. Run "pnpm test:extension ${plan.extensionId} -- --dry-run" to inspect the resolved roots.`, ); - process.exit(1); + return; } if (dryRun) { diff --git a/test/scripts/test-extension.test.ts b/test/scripts/test-extension.test.ts index 8919130c19a..ed80eb861b2 100644 --- a/test/scripts/test-extension.test.ts +++ b/test/scripts/test-extension.test.ts @@ -35,6 +35,14 @@ describe("scripts/test-extension.mjs", () => { expect(plan.testFiles.some((file) => file.startsWith("extensions/firecrawl/"))).toBe(true); }); + it("returns an empty test list for provider extensions without dedicated tests", () => { + const plan = resolveExtensionTestPlan({ targetArg: "openrouter", cwd: process.cwd() }); + + expect(plan.extensionId).toBe("openrouter"); + expect(plan.config).toBe("vitest.extensions.config.ts"); + expect(plan.testFiles).toEqual([]); + }); + it("includes paired src roots when they contain tests", () => { const plan = resolveExtensionTestPlan({ targetArg: "line", cwd: process.cwd() }); @@ -52,6 +60,15 @@ describe("scripts/test-extension.mjs", () => { expect(plan.extensionDir).toBe("extensions/slack"); }); + it("treats extensions without dedicated tests as a clean dry-run skip", () => { + const stdout = execFileSync(process.execPath, [scriptPath, "openrouter"], { + cwd: process.cwd(), + encoding: "utf8", + }); + + expect(stdout).toContain("No tests found for extensions/openrouter; skipping."); + }); + it("maps changed paths back to extension ids", () => { const extensionIds = detectChangedExtensionIds([ "extensions/slack/src/channel.ts",