mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:00:41 +00:00
test: clarify plugin registry cleanup
This commit is contained in:
@@ -121,7 +121,7 @@ describe("registerPluginHttpRoute", () => {
|
||||
|
||||
expect(registry.httpRoutes).toHaveLength(0);
|
||||
expect(logs).toEqual(['plugin: webhook path missing for account "default"']);
|
||||
expect(() => unregister()).not.toThrow();
|
||||
unregister();
|
||||
});
|
||||
|
||||
it("replaces stale route on same path when replaceExisting=true", () => {
|
||||
|
||||
@@ -486,7 +486,7 @@ describe("plugin interactive handlers", () => {
|
||||
};
|
||||
|
||||
try {
|
||||
expect(() => clearPluginInteractiveHandlers()).not.toThrow();
|
||||
clearPluginInteractiveHandlers();
|
||||
const hydrated = globalStore[stateKey] as {
|
||||
interactiveHandlers?: Map<string, unknown>;
|
||||
callbackDedupe?: { clear: () => void };
|
||||
@@ -496,7 +496,7 @@ describe("plugin interactive handlers", () => {
|
||||
if (!hydrated.callbackDedupe) {
|
||||
throw new Error("expected hydrated callback dedupe");
|
||||
}
|
||||
expect(() => hydrated.callbackDedupe?.clear()).not.toThrow();
|
||||
hydrated.callbackDedupe.clear();
|
||||
expect(hydrated.inflightCallbackDedupe).toBeInstanceOf(Set);
|
||||
|
||||
const handler = vi.fn(async () => ({ handled: true }));
|
||||
|
||||
Reference in New Issue
Block a user