test(perf): collapse overlapping preaction scenarios

This commit is contained in:
Peter Steinberger
2026-03-02 14:06:53 +00:00
parent cd653c55d7
commit 98e5851d8a

View File

@@ -157,27 +157,28 @@ describe("registerPreActionHooks", () => {
commandPath: ["message", "send"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
});
vi.clearAllMocks();
it("loads plugin registry for configure command", async () => {
await runPreAction({
parseArgv: ["configure"],
processArgv: ["node", "openclaw", "configure"],
});
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
runtime: runtimeMock,
commandPath: ["configure"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
});
it("skips config guard for doctor command", async () => {
it("skips preaction work for doctor and help/version argv", async () => {
await runPreAction({
parseArgv: ["doctor"],
processArgv: ["node", "openclaw", "doctor"],
});
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
});
it("skips preaction work when argv indicates help/version", async () => {
vi.clearAllMocks();
await runPreAction({
parseArgv: ["status"],
processArgv: ["node", "openclaw", "--version"],