mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:18:28 +00:00
test(telegram): cover autoSelectFamily env precedence
This commit is contained in:
@@ -27,6 +27,30 @@ describe("resolveTelegramAutoSelectFamilyDecision", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("prefers env enable over config", () => {
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({
|
||||
env: { OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY: "1" },
|
||||
network: { autoSelectFamily: false },
|
||||
nodeMajor: 22,
|
||||
});
|
||||
expect(decision).toEqual({
|
||||
value: true,
|
||||
source: "env:OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY",
|
||||
});
|
||||
});
|
||||
|
||||
it("prefers env disable over config", () => {
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({
|
||||
env: { OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY: "1" },
|
||||
network: { autoSelectFamily: true },
|
||||
nodeMajor: 22,
|
||||
});
|
||||
expect(decision).toEqual({
|
||||
value: false,
|
||||
source: "env:OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY",
|
||||
});
|
||||
});
|
||||
|
||||
it("uses config override when provided", () => {
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({
|
||||
env: {},
|
||||
|
||||
Reference in New Issue
Block a user