test: dedupe copilot model fetch mock reads · openclaw/openclaw@b430270
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
File tree
extensions/github-copilot
| Original file line number | Diff line number | Diff line change |
|---|
@@ -491,7 +491,7 @@ describe("fetchCopilotModelCatalog", () => {
|
491 | 491 | }); |
492 | 492 | |
493 | 493 | expect(fetchImpl).toHaveBeenCalledTimes(1); |
494 | | -const [calledUrl, calledInit] = fetchImpl.mock.calls.at(0) ?? []; |
| 494 | +const [calledUrl, calledInit] = fetchImpl.mock.calls[0] ?? []; |
495 | 495 | expect(calledUrl).toBe("https://api.githubcopilot.com/models"); |
496 | 496 | expect((calledInit as RequestInit).method).toBe("GET"); |
497 | 497 | expect(((calledInit as RequestInit).headers as Record<string, string>).Authorization).toBe( |
@@ -539,7 +539,7 @@ describe("fetchCopilotModelCatalog", () => {
|
539 | 539 | fetchImpl: fetchImpl as unknown as typeof fetch, |
540 | 540 | }); |
541 | 541 | |
542 | | -expect(fetchImpl.mock.calls.at(0)?.[0]).toBe("https://api.githubcopilot.com/models"); |
| 542 | +expect(fetchImpl.mock.calls[0]?.[0]).toBe("https://api.githubcopilot.com/models"); |
543 | 543 | }); |
544 | 544 | |
545 | 545 | it("dedupes by id when API returns duplicates", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。