mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 07:27:28 +00:00
CLI routes tests: assert status plugin preload
This commit is contained in:
@@ -13,15 +13,9 @@ describe("program routes", () => {
|
|||||||
await expect(route?.run(argv)).resolves.toBe(false);
|
await expect(route?.run(argv)).resolves.toBe(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
it("matches status route and loads plugins for human-readable output", () => {
|
it("matches status route and always loads plugins for security parity", () => {
|
||||||
const route = expectRoute(["status"]);
|
const route = expectRoute(["status"]);
|
||||||
expect(typeof route?.loadPlugins).toBe("function");
|
expect(route?.loadPlugins).toBe(true);
|
||||||
const loadPlugins = route?.loadPlugins;
|
|
||||||
if (typeof loadPlugins !== "function") {
|
|
||||||
throw new Error("expected status route loadPlugins predicate");
|
|
||||||
}
|
|
||||||
expect(loadPlugins(["node", "openclaw", "status"])).toBe(true);
|
|
||||||
expect(loadPlugins(["node", "openclaw", "status", "--json"])).toBe(false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches health route without eager plugin loading", () => {
|
it("matches health route without eager plugin loading", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user