Use the API URL from the environment if it is present.
This commit is contained in:
parent
a6d09016e7
commit
bbdc9efa94
42 changed files with 122 additions and 22 deletions
11
lib/api-client.test.js
generated
11
lib/api-client.test.js
generated
|
|
@ -81,6 +81,17 @@ ava_1.default.beforeEach(() => {
|
|||
userAgent: `CodeQL-Action/${pkg.version}`,
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Get the API with an API URL directly", async (t) => {
|
||||
doTest(t, {
|
||||
auth: "xyz",
|
||||
url: "http://github.localhost",
|
||||
apiURL: "http://api.github.localhost",
|
||||
}, undefined, {
|
||||
auth: "token xyz",
|
||||
baseUrl: "http://api.github.localhost",
|
||||
userAgent: `CodeQL-Action/${pkg.version}`,
|
||||
});
|
||||
});
|
||||
function doTest(t, clientArgs, clientOptions, expected) {
|
||||
(0, api_client_1.getApiClient)(clientArgs, clientOptions);
|
||||
const firstCallArgs = githubStub.args[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue