test: clarify plugin registry cleanup

This commit is contained in:
Peter Steinberger
2026-05-08 12:41:07 +01:00
parent 6dec8ee440
commit 79b88224e1
2 changed files with 3 additions and 3 deletions

View File

@@ -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", () => {

View File

@@ -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 }));