test: dedupe channel setup mock reads

This commit is contained in:
Peter Steinberger
2026-05-13 03:16:21 +01:00
parent b2da3e0a02
commit 9287aa5ef7

View File

@@ -79,7 +79,7 @@ function makePluginRegistry(overrides: Partial<PluginRegistry> = {}): PluginRegi
}
function callArg<T>(mock: { mock: { calls: unknown[][] } }, index = 0, _type?: (value: T) => T): T {
const call = mock.mock.calls.at(index);
const call = mock.mock.calls[index];
if (!call) {
throw new Error(`Expected mock call ${index}`);
}
@@ -87,7 +87,7 @@ function callArg<T>(mock: { mock: { calls: unknown[][] } }, index = 0, _type?: (
}
function mockCall(mock: { mock: { calls: unknown[][] } }, index = 0): unknown[] {
const call = mock.mock.calls.at(index);
const call = mock.mock.calls[index];
if (!call) {
throw new Error(`Expected mock call ${index}`);
}