Skip to content

Commit 31e38bc

Browse files
committed
Add very basic getApiClientWithExternalAuth test
1 parent 4037ae0 commit 31e38bc

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/api-client.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as github from "@actions/github";
22
import * as githubUtils from "@actions/github/lib/utils";
3+
import * as retry from "@octokit/plugin-retry";
34
import test from "ava";
45
import * as sinon from "sinon";
56
import { ProxyAgent } from "undici";
@@ -292,6 +293,19 @@ test("makeProxyRequestOptions - returns fetch with custom proxy", async (t) => {
292293
);
293294
});
294295

296+
test.serial(
297+
"getApiClientWithExternalAuth constructs clients with or without tokens",
298+
(t) => {
299+
t.notThrows(() => {
300+
api.getApiClientWithExternalAuth(SAMPLE_DOTCOM_API_DETAILS);
301+
api.getApiClientWithExternalAuth({
302+
...SAMPLE_DOTCOM_API_DETAILS,
303+
auth: undefined,
304+
});
305+
});
306+
},
307+
);
308+
295309
test("getAuthorizationHeaderFor - returns undefined if there's no token", (t) => {
296310
const logger = new RecordingLogger();
297311

0 commit comments

Comments
 (0)