mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 03:11:10 +00:00
Merged via squash.
Prepared head SHA: 39c15ee70d
Co-authored-by: kvokka <15954013+kvokka@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { __test__ } from "./logger.js";
|
|
|
|
describe("shouldSkipMutatingLoggingConfigRead", () => {
|
|
it("matches config schema and validate invocations", () => {
|
|
expect(
|
|
__test__.shouldSkipMutatingLoggingConfigRead(["node", "openclaw", "config", "schema"]),
|
|
).toBe(true);
|
|
expect(
|
|
__test__.shouldSkipMutatingLoggingConfigRead(["node", "openclaw", "config", "validate"]),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("handles root flags before config validate", () => {
|
|
expect(
|
|
__test__.shouldSkipMutatingLoggingConfigRead([
|
|
"node",
|
|
"openclaw",
|
|
"--profile",
|
|
"work",
|
|
"--no-color",
|
|
"config",
|
|
"validate",
|
|
"--json",
|
|
]),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("does not match other commands", () => {
|
|
expect(
|
|
__test__.shouldSkipMutatingLoggingConfigRead(["node", "openclaw", "config", "get", "foo"]),
|
|
).toBe(false);
|
|
expect(__test__.shouldSkipMutatingLoggingConfigRead(["node", "openclaw", "status"])).toBe(
|
|
false,
|
|
);
|
|
});
|
|
});
|