CLI routes tests: assert status plugin preload

This commit is contained in:
Vincent Koc
2026-03-01 12:55:11 -08:00
parent 266084f4c8
commit 125ea585dd

View File

@@ -13,15 +13,9 @@ describe("program routes", () => {
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"]);
expect(typeof route?.loadPlugins).toBe("function");
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);
expect(route?.loadPlugins).toBe(true);
});
it("matches health route without eager plugin loading", () => {