test: tighten extension script mock assertion

This commit is contained in:
Shakker
2026-05-08 20:41:06 +01:00
parent bab07e994f
commit 700230c07c

View File

@@ -35,7 +35,7 @@ function runScript(args: string[], cwd = process.cwd()) {
}
function requireFirstMockArg<T>(mock: { mock: { calls: Array<[T, ...unknown[]]> } }): T {
const arg = mock.mock.calls[0]?.[0];
const [arg] = mock.mock.calls[0] ?? [];
if (arg === undefined) {
throw new Error("expected first mock call argument");
}