Files
chat/packages/api/jest.setup.cjs
zeekay 12b6f6ece2 chat: de-librechat — CHAT_ env, chat.yaml, Chat identifiers; README rewrite + zh
- env vars LIBRECHAT_* -> CHAT_* (USER_ID, GRAPH_ACCESS_TOKEN, OPENID_*, LOG_DIR, ...)
- config file librechat.yaml -> chat.yaml (matches prod CONFIG_PATH) + .example
- identifiers LibreChat -> Chat (extractChatParams, ChatKeys, ChatParams, importChatConvo)
- lowercase librechat -> chat: i18n keys, helm charts (helm/chat, helm/chat-rag-api),
  CI workflows, OTel service/span keys, codeapi JWT issuer, x-chat-thread-id header
- README.md rewritten (Node 24, pnpm 10, Zen family, Cloud Agents, hanzo.id OIDC);
  README.zh.md added (Simplified Chinese)

MIT LICENSE copyright + one 'Forked from LibreChat (MIT)' attribution retained.
Build 5/5 green.
2026-07-14 10:41:50 -07:00

25 lines
958 B
JavaScript

/**
* `undici` (transitive dep of `@hanzochat/agents` and others) references
* `globalThis.File` from `node:buffer`. Node 20+ exposes it as a global;
* Node 18 / certain WSL toolchains do not, which surfaces as a
* `ReferenceError: File is not defined` at module-load time the first
* time a test imports `@hanzochat/agents`. Jest under those Node
* versions blows up before the suite can even start.
*
* Pull `File` from `node:buffer` (available since Node 18.x) and assign
* it onto `globalThis` if missing. Production code never depends on
* this — the polyfill only activates inside Jest.
*/
if (typeof globalThis.File === 'undefined') {
try {
const { File } = require('node:buffer');
if (File != null) {
globalThis.File = File;
}
} catch {
// Older Node versions without `node:buffer.File`. Chat doesn't
// support those anyway; let the test fail loudly rather than mask a
// real environment issue.
}
}