mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
test: guard reply media mock calls
This commit is contained in:
@@ -54,7 +54,7 @@ function expectOutboundAttachmentCall(
|
||||
mediaUrl: string,
|
||||
mediaMaxBytes: number,
|
||||
): Record<string, unknown> {
|
||||
const call = resolveOutboundAttachmentFromUrl.mock.calls[index] as unknown[] | undefined;
|
||||
const call = resolveOutboundAttachmentFromUrl.mock.calls.at(index) as unknown[] | undefined;
|
||||
if (!call) {
|
||||
throw new Error(`missing outbound attachment call ${index + 1}`);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ function expectOutboundAttachmentCall(
|
||||
}
|
||||
|
||||
function expectAgentScopedMediaAccessCall(): Record<string, unknown> {
|
||||
const call = resolveAgentScopedOutboundMediaAccess.mock.calls[0] as unknown[] | undefined;
|
||||
const call = resolveAgentScopedOutboundMediaAccess.mock.calls.at(0) as unknown[] | undefined;
|
||||
if (!call) {
|
||||
throw new Error("missing agent scoped media access call");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user