Files
OmniRoute/tests/unit/credential-health-disable-return.test.ts
Ravi Tharuma 30e20c6b60 fix(startup): log when credential health check is disabled (#11016) (#11021)
5 — initCredentialHealthCheck() agora retorna se o sweep está armado; boot loga "disabled" quando OMNIROUTE_DISABLE_CREDENTIAL_HEALTH_CHECK está setado, em vez de sempre "started". 3 testes verdes, comportamento do sweep inalterado. Fecha #11016.
2026-08-21 14:00:27 -03:00

15 lines
565 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
// #11016: OMNIROUTE_DISABLE_CREDENTIAL_HEALTH_CHECK must be observable.
// Set the kill-switch BEFORE importing the scheduler — the module auto-inits
// on first import.
process.env.OMNIROUTE_DISABLE_CREDENTIAL_HEALTH_CHECK = "true";
test("initCredentialHealthCheck returns false when the disable env is set", async () => {
const { initCredentialHealthCheck } = await import(
"../../src/lib/credentialHealth/scheduler.ts"
);
assert.equal(initCredentialHealthCheck(), false);
});