Files
OmniRoute/tests/unit/chatcore-imports-cleanly.test.ts
Hernan Javier Ardila Sanchez fd26e601a2 fix(dashboard): use lightweight ping endpoint for MaintenanceBanner (fixes #3040) (#3043)
Integrated into release/v3.8.8. Applied review fixes: moved the SELECT 1 into a pingDb() db helper (no raw SQL in route, Hard Rule #5) + the 503 catch no longer leaks err.message (Hard Rule #12). Thanks @herjarsa!
2026-06-01 14:30:17 -03:00

24 lines
966 B
TypeScript

/**
* Regression guard: `open-sse/handlers/chatCore.ts` must transform/compile.
*
* `handleChatCore` declared `const settings` twice in the same function scope
* (a "fetch once, reuse" const near the top + a duplicate added by the per-key
* stream-default-mode feature). esbuild/tsx rejected it with
* "The symbol 'settings' has already been declared", which turned EVERY test
* that imports chatCore red and broke the production build.
*
* Importing the module forces the transform; if the duplicate declaration
* returns, this import throws and the test fails loudly.
*/
import test from "node:test";
import assert from "node:assert/strict";
test("chatCore.ts imports without a duplicate-declaration transform error", async () => {
const mod = await import("../../open-sse/handlers/chatCore.ts");
assert.equal(
typeof mod.handleChatCore,
"function",
"handleChatCore must be importable (no duplicate `const settings` in scope)"
);
});