mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 12:22:14 +03:00
Release v3.8.24 — see CHANGELOG.md [3.8.24] for the full notes and the PR description for the contributors hall. Integration of release/v3.8.24 into main.
15 lines
612 B
TypeScript
15 lines
612 B
TypeScript
import { describe, it } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { decideProxyResolutionFailure } from "../../src/sse/handlers/chatHelpers";
|
|
|
|
describe("decideProxyResolutionFailure", () => {
|
|
it("rethrows (fail-closed) by default", () => {
|
|
const err = new Error("boom");
|
|
assert.throws(() => decideProxyResolutionFailure(err, { PROXY_FAIL_OPEN: undefined }), /boom/);
|
|
});
|
|
it("returns null (fail-open) only when PROXY_FAIL_OPEN=true", () => {
|
|
const err = new Error("boom");
|
|
assert.equal(decideProxyResolutionFailure(err, { PROXY_FAIL_OPEN: "true" }), null);
|
|
});
|
|
});
|