File size: 890 Bytes
fc93158 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import { describe, expect, it } from "vitest";
import { __test__ } from "./logger.js";
describe("shouldSkipLoadConfigFallback", () => {
it("matches config validate invocations", () => {
expect(__test__.shouldSkipLoadConfigFallback(["node", "openclaw", "config", "validate"])).toBe(
true,
);
});
it("handles root flags before config validate", () => {
expect(
__test__.shouldSkipLoadConfigFallback([
"node",
"openclaw",
"--profile",
"work",
"--no-color",
"config",
"validate",
"--json",
]),
).toBe(true);
});
it("does not match other commands", () => {
expect(
__test__.shouldSkipLoadConfigFallback(["node", "openclaw", "config", "get", "foo"]),
).toBe(false);
expect(__test__.shouldSkipLoadConfigFallback(["node", "openclaw", "status"])).toBe(false);
});
});
|