mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 02:55:16 +00:00
test: dedupe runtime llm mock reads
This commit is contained in:
parent
d42b3c2b4a
commit
3eaefda824
1 changed files with 2 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ function expectSingleCallFirstArg(
|
|||
label = "mock first argument",
|
||||
): Record<string, unknown> {
|
||||
expect(mock.mock.calls).toHaveLength(1);
|
||||
const [firstArg] = mock.mock.calls.at(0) ?? [];
|
||||
const [firstArg] = mock.mock.calls[0] ?? [];
|
||||
const record = requireRecord(firstArg, label);
|
||||
expectFields(record, expected);
|
||||
return record;
|
||||
|
|
@ -100,7 +100,7 @@ function expectSingleLogPayload(
|
|||
expected: Record<string, unknown>,
|
||||
): Record<string, unknown> {
|
||||
expect(loggerMethod.mock.calls).toHaveLength(1);
|
||||
const [actualMessage, payload] = loggerMethod.mock.calls.at(0) ?? [];
|
||||
const [actualMessage, payload] = loggerMethod.mock.calls[0] ?? [];
|
||||
expect(actualMessage).toBe(message);
|
||||
const payloadRecord = requireRecord(payload, "log payload");
|
||||
expectFields(payloadRecord, expected);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue