mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 08:02:04 +00:00
perf(status): defer heavy startup loading
This commit is contained in:
@@ -190,6 +190,19 @@ describe("registerPreActionHooks", () => {
|
||||
});
|
||||
|
||||
it("applies --json stdout suppression only for explicit JSON output commands", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["status"],
|
||||
processArgv: ["node", "openclaw", "status", "--json"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["status"],
|
||||
suppressDoctorStdout: true,
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
|
||||
vi.clearAllMocks();
|
||||
await runPreAction({
|
||||
parseArgv: ["update", "status", "--json"],
|
||||
processArgv: ["node", "openclaw", "update", "status", "--json"],
|
||||
@@ -200,6 +213,7 @@ describe("registerPreActionHooks", () => {
|
||||
commandPath: ["update", "status"],
|
||||
suppressDoctorStdout: true,
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
|
||||
vi.clearAllMocks();
|
||||
await runPreAction({
|
||||
|
||||
Reference in New Issue
Block a user