Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(tests): CORS test now checks object body instead of entire file

diegosouzapwcd67c18049b7
diff --git a/tests/integration/proxy-pipeline.test.ts b/tests/integration/proxy-pipeline.test.ts
index 6895d258a1..942069abfe 100644
--- a/tests/integration/proxy-pipeline.test.ts
+++ b/tests/integration/proxy-pipeline.test.ts
@@ -405,6 +405,9 @@ describe("CORS — centralized configuration", () => {
it("should export CORS_HEADERS without a wildcard origin", () => {
const src = readSrc("shared/utils/cors.ts");
assert.match(src, /CORS_HEADERS/);
- assert.doesNotMatch(src, /Access-Control-Allow-Origin/);
+ // Extract the CORS_HEADERS object body (between { and }) to avoid matching JSDoc comments
+ const objMatch = src.match(/CORS_HEADERS\s*=\s*\{([^}]+)\}/);
+ assert.ok(objMatch, "CORS_HEADERS object should be found");
+ assert.doesNotMatch(objMatch[1], /Access-Control-Allow-Origin/);
});
});