Use the API URL from the environment if it is present.

This commit is contained in:
Chris Gavin 2022-08-10 21:11:50 +01:00
parent a6d09016e7
commit bbdc9efa94
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
42 changed files with 122 additions and 22 deletions

View file

@ -207,6 +207,7 @@ test("getGitHubVersion", async (t) => {
const v = await util.getGitHubVersion({
auth: "",
url: "https://github.com",
apiURL: undefined,
});
t.deepEqual(util.GitHubVariant.DOTCOM, v.type);
@ -214,6 +215,7 @@ test("getGitHubVersion", async (t) => {
const v2 = await util.getGitHubVersion({
auth: "",
url: "https://ghe.example.com",
apiURL: undefined,
});
t.deepEqual(
{ type: util.GitHubVariant.GHES, version: "2.0" } as util.GitHubVersion,
@ -224,6 +226,7 @@ test("getGitHubVersion", async (t) => {
const ghae = await util.getGitHubVersion({
auth: "",
url: "https://example.githubenterprise.com",
apiURL: undefined,
});
t.deepEqual({ type: util.GitHubVariant.GHAE }, ghae);
@ -231,6 +234,7 @@ test("getGitHubVersion", async (t) => {
const v3 = await util.getGitHubVersion({
auth: "",
url: "https://ghe.example.com",
apiURL: undefined,
});
t.deepEqual({ type: util.GitHubVariant.DOTCOM }, v3);
});