mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 04:17:48 +00:00
test: fail fast on google prompt cache calls
This commit is contained in:
@@ -81,9 +81,14 @@ function createCapturingStreamFn(result = "stream") {
|
||||
}
|
||||
|
||||
function callArg(mock: { mock: { calls: unknown[][] } }, callIndex: number, argIndex: number) {
|
||||
const call = mock.mock.calls[callIndex];
|
||||
expect(call).toBeDefined();
|
||||
return call?.[argIndex];
|
||||
const call = mock.mock.calls.at(callIndex);
|
||||
if (!call) {
|
||||
throw new Error(`Expected mock call ${callIndex}`);
|
||||
}
|
||||
if (argIndex >= call.length) {
|
||||
throw new Error(`Expected mock call ${callIndex} argument ${argIndex}`);
|
||||
}
|
||||
return call[argIndex];
|
||||
}
|
||||
|
||||
function fetchInit(fetchMock: { mock: { calls: unknown[][] } }, callIndex = 0): RequestInit {
|
||||
|
||||
Reference in New Issue
Block a user