test: tighten plugin loader hook assertion

This commit is contained in:
Peter Steinberger
2026-05-09 04:05:24 +01:00
parent 1c19ce4e1b
commit 5bec7022c7

View File

@@ -107,10 +107,10 @@ function countMatching<T>(items: readonly T[], predicate: (item: T) => boolean):
}
function expectGlobalHookRunner(runner: ReturnType<typeof getGlobalHookRunner>): GlobalHookRunner {
expect(runner).toEqual(expect.objectContaining({ hasHooks: expect.any(Function) }));
if (runner === null) {
throw new Error("Expected global hook runner");
}
expect(typeof runner.hasHooks).toBe("function");
return runner;
}