-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathauth_host.e2e.test.ts
More file actions
31 lines (28 loc) · 1.21 KB
/
Copy pathauth_host.e2e.test.ts
File metadata and controls
31 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
import { describe, expect, it } from "vitest";
import { createSdkTestContext } from "./harness/sdkTestContext.js";
describe.each([
["tenant.ghe.example", "fallback.ghe.example", "https://tenant.ghe.example"],
["", "fallback.ghe.example", "https://fallback.ghe.example"],
["", "", "https://github.com"],
])(
"auth host with COPILOT_GH_HOST=%s and GH_HOST=%s",
async (copilotHost, ghHost, expectedHost) => {
const { copilotClient: client } = await createSdkTestContext({
copilotClientOptions: {
env: {
COPILOT_GH_HOST: copilotHost,
GH_HOST: ghHost,
},
},
});
it("reports the selected authentication host", async () => {
await client.start();
const status = await client.getAuthStatus();
expect(status.isAuthenticated).toBe(true);
expect(status.host).toBe(expectedHost);
});
}
);