test: tighten extension auth assertions

This commit is contained in:
Peter Steinberger
2026-05-11 14:02:30 +01:00
parent 0a92d7a8ff
commit 58087ef3d6
3 changed files with 36 additions and 43 deletions

View File

@@ -114,9 +114,7 @@ describe("githubCopilotMemoryEmbeddingProviderAdapter", () => {
const result = await githubCopilotMemoryEmbeddingProviderAdapter.create(defaultCreateOptions());
expect(result.provider?.model).toBe("text-embedding-3-small");
expect(resolveCopilotApiTokenMock).toHaveBeenCalledWith(
expect.objectContaining({ githubToken: "gh_test_token_123" }),
);
expect(resolveCopilotApiTokenMock.mock.calls[0]?.[0]?.githubToken).toBe("gh_test_token_123");
});
it("matches embedding-capable models when supported_endpoints is missing or malformed", async () => {
@@ -214,12 +212,8 @@ describe("githubCopilotMemoryEmbeddingProviderAdapter", () => {
} as never);
expect(resolveFirstGithubTokenMock).toHaveBeenCalled();
expect(resolveCopilotApiTokenMock).toHaveBeenCalledWith(
expect.objectContaining({
env: process.env,
githubToken: "gh_remote_token",
}),
);
expect(resolveCopilotApiTokenMock.mock.calls[0]?.[0]?.env).toBe(process.env);
expect(resolveCopilotApiTokenMock.mock.calls[0]?.[0]?.githubToken).toBe("gh_remote_token");
const discoveryCall = fetchWithSsrFGuardMock.mock.calls[0]?.[0] as {
init: { headers: Record<string, string> };