mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-07-09 17:28:45 +00:00
fix(ai): mock copilot models in oauth test
Some checks are pending
CI / build-check-test (push) Waiting to run
Some checks are pending
CI / build-check-test (push) Waiting to run
This commit is contained in:
parent
aa6bdd778a
commit
f7d3331df6
1 changed files with 5 additions and 1 deletions
|
|
@ -69,7 +69,11 @@ describe.sequential("OAuthAuth adapters", () => {
|
|||
it("github-copilot refresh preserves the enterprise domain", async () => {
|
||||
const fetchedUrls: string[] = [];
|
||||
const fetchMock = vi.fn(async (input: unknown) => {
|
||||
fetchedUrls.push(typeof input === "string" ? input : String(input));
|
||||
const url = typeof input === "string" ? input : String(input);
|
||||
fetchedUrls.push(url);
|
||||
if (url.endsWith("/models")) {
|
||||
return jsonResponse({ data: [] });
|
||||
}
|
||||
return jsonResponse({ token: "new-token", expires_at: 9999999999 });
|
||||
});
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue