mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 20:35:39 -06:00
test: guard server cron mock args
This commit is contained in:
@@ -126,8 +126,13 @@ function callArg(
|
||||
label: string,
|
||||
) {
|
||||
const call = mock.mock.calls.at(callIndex);
|
||||
expect(call, label).toBeDefined();
|
||||
return call?.[argIndex];
|
||||
if (!call) {
|
||||
throw new Error(`Expected mock call: ${label}`);
|
||||
}
|
||||
if (argIndex >= call.length) {
|
||||
throw new Error(`Expected mock call argument ${argIndex}: ${label}`);
|
||||
}
|
||||
return call[argIndex];
|
||||
}
|
||||
|
||||
function expectHookContext(callIndex: number, fields: { config?: unknown; hasGetCron?: boolean }) {
|
||||
|
||||
Reference in New Issue
Block a user