mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { isDiagnosticFlagEnabled, resolveDiagnosticFlags } from "./diagnostic-flags.js";
|
||||
|
||||
describe("diagnostic flags", () => {
|
||||
it("merges config + env flags", () => {
|
||||
const cfg = {
|
||||
diagnostics: { flags: ["telegram.http", "cache.*"] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
const env = {
|
||||
CLAWDBOT_DIAGNOSTICS: "foo,bar",
|
||||
OPENCLAW_DIAGNOSTICS: "foo,bar",
|
||||
} as NodeJS.ProcessEnv;
|
||||
|
||||
const flags = resolveDiagnosticFlags(cfg, env);
|
||||
@@ -20,12 +20,12 @@ describe("diagnostic flags", () => {
|
||||
});
|
||||
|
||||
it("treats env true as wildcard", () => {
|
||||
const env = { CLAWDBOT_DIAGNOSTICS: "1" } as NodeJS.ProcessEnv;
|
||||
const env = { OPENCLAW_DIAGNOSTICS: "1" } as NodeJS.ProcessEnv;
|
||||
expect(isDiagnosticFlagEnabled("anything.here", undefined, env)).toBe(true);
|
||||
});
|
||||
|
||||
it("treats env false as disabled", () => {
|
||||
const env = { CLAWDBOT_DIAGNOSTICS: "0" } as NodeJS.ProcessEnv;
|
||||
const env = { OPENCLAW_DIAGNOSTICS: "0" } as NodeJS.ProcessEnv;
|
||||
expect(isDiagnosticFlagEnabled("telegram.http", undefined, env)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user