@@ -208,18 +208,12 @@ describe("tavily tools", () => {
|
208 | 208 | await searchTool.execute("search-call", { query: "openclaw" }); |
209 | 209 | await extractTool.execute("extract-call", { urls: ["https://example.com"] }); |
210 | 210 | |
211 | | -expect(runTavilySearch).toHaveBeenCalledWith( |
212 | | -expect.objectContaining({ |
213 | | -cfg: runtimeConfig, |
214 | | -query: "openclaw", |
215 | | -}), |
216 | | -); |
217 | | -expect(runTavilyExtract).toHaveBeenCalledWith( |
218 | | -expect.objectContaining({ |
219 | | -cfg: runtimeConfig, |
220 | | -urls: ["https://example.com"], |
221 | | -}), |
222 | | -); |
| 211 | +const searchParams = runTavilySearch.mock.calls[0]?.[0]; |
| 212 | +expect(searchParams?.cfg).toBe(runtimeConfig); |
| 213 | +expect(searchParams?.query).toBe("openclaw"); |
| 214 | +const extractParams = runTavilyExtract.mock.calls[0]?.[0]; |
| 215 | +expect(extractParams?.cfg).toBe(runtimeConfig); |
| 216 | +expect(extractParams?.urls).toEqual(["https://example.com"]); |
223 | 217 | }); |
224 | 218 | |
225 | 219 | it("drops empty domain arrays and forwards query-scoped chunking", async () => { |
@@ -255,14 +249,11 @@ describe("tavily tools", () => {
|
255 | 249 | chunks_per_source: 2, |
256 | 250 | }); |
257 | 251 | |
258 | | -expect(runTavilyExtract).toHaveBeenCalledWith( |
259 | | -expect.objectContaining({ |
260 | | -cfg: {}, |
261 | | -urls: ["https://example.com"], |
262 | | -query: "pricing", |
263 | | -chunksPerSource: 2, |
264 | | -}), |
265 | | -); |
| 252 | +const extractParams = runTavilyExtract.mock.calls[0]?.[0]; |
| 253 | +expect(extractParams?.cfg).toEqual({}); |
| 254 | +expect(extractParams?.urls).toEqual(["https://example.com"]); |
| 255 | +expect(extractParams?.query).toBe("pricing"); |
| 256 | +expect(extractParams?.chunksPerSource).toBe(2); |
266 | 257 | }); |
267 | 258 | |
268 | 259 | it("rejects chunks_per_source without query", async () => { |
|