test: reuse watch-node mock call guard

This commit is contained in:
Peter Steinberger
2026-05-12 03:50:05 +01:00
parent cb2b399368
commit ca95f20c6f

View File

@@ -124,11 +124,7 @@ describe("watch-node script", () => {
});
expect(createWatcher).toHaveBeenCalledTimes(1);
const firstWatcherCall = createWatcher.mock.calls[0];
if (firstWatcherCall === undefined) {
throw new Error("expected watcher setup call");
}
const [watchPaths, watchOptions] = firstWatcherCall as unknown as [
const [watchPaths, watchOptions] = requireMockCall(createWatcher, 0) as unknown as [
string[],
{ ignoreInitial: boolean; ignored: (watchPath: string) => boolean },
];