mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 14:30:46 +00:00
test: tighten extension script mock assertion
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user