mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 11:43:03 +00:00
test: dedupe tools catalog mock reads
This commit is contained in:
@@ -54,7 +54,7 @@ function createInvokeParams(params: Record<string, unknown>) {
|
||||
}
|
||||
|
||||
function firstMockArg(mock: { mock: { calls: unknown[][] } }, label: string): unknown {
|
||||
const arg = mock.mock.calls.at(0)?.at(0);
|
||||
const arg = mock.mock.calls[0]?.[0];
|
||||
if (arg === undefined) {
|
||||
throw new Error(`Expected ${label}`);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ function firstMockArg(mock: { mock: { calls: unknown[][] } }, label: string): un
|
||||
}
|
||||
|
||||
function respondCall(respond: ReturnType<typeof vi.fn>): RespondCall {
|
||||
const call = respond.mock.calls.at(0) as RespondCall | undefined;
|
||||
const call = respond.mock.calls[0] as RespondCall | undefined;
|
||||
if (!call) {
|
||||
throw new Error("expected respond call");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user