mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test(perf): prune redundant preaction command-path cases
This commit is contained in:
@@ -157,28 +157,9 @@ describe("registerPreActionHooks", () => {
|
||||
commandPath: ["message", "send"],
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
vi.clearAllMocks();
|
||||
|
||||
await runPreAction({
|
||||
parseArgv: ["configure"],
|
||||
processArgv: ["node", "openclaw", "configure"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["configure"],
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("skips preaction work for doctor and help/version argv", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["doctor"],
|
||||
processArgv: ["node", "openclaw", "doctor"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
|
||||
vi.clearAllMocks();
|
||||
it("skips preaction work when argv indicates help/version", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["status"],
|
||||
processArgv: ["node", "openclaw", "--version"],
|
||||
|
||||
Reference in New Issue
Block a user