Skip to content

Commit 4e462a8

Browse files
committed
replace nock with fetch-mock, run tests simultaneously
1 parent 467dfa0 commit 4e462a8

12 files changed

+4772
-2970
lines changed

lib/octokit.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { throttling } from "@octokit/plugin-throttling";
1212
import urljoin from "url-join";
1313
import { HttpProxyAgent } from "http-proxy-agent";
1414
import { HttpsProxyAgent } from "https-proxy-agent";
15-
import nodeFetch from "node-fetch";
1615

1716
import { RETRY_CONF } from "./definitions/retry.js";
1817
import { THROTTLE_CONF } from "./definitions/throttle.js";
@@ -45,7 +44,7 @@ export const SemanticReleaseOctokit = Octokit.plugin(
4544

4645
/**
4746
* @param {{githubToken: string, proxy: any} | {githubUrl: string, githubApiPathPrefix: string, githubToken: string, proxy: any}} options
48-
* @returns {{ auth: string, baseUrl: undefined | string, request: { agent?: any, fetch: nodeFetch } }}
47+
* @returns {{ auth: string, baseUrl?: string, request: { agent?: any } }}
4948
*/
5049
export function toOctokitOptions(options) {
5150
const baseUrl =
@@ -62,14 +61,9 @@ export function toOctokitOptions(options) {
6261
: undefined;
6362

6463
return {
65-
baseUrl,
64+
...(baseUrl ? { baseUrl } : {}),
6665
auth: options.githubToken,
6766
request: {
68-
// TODO: we temporary use use `node-fetch` because `nock` does not support
69-
// mocking Node's native fetch yet. The plan is to replace nock with `fetch-mock`
70-
// before merging this PR.
71-
fetch: nodeFetch,
72-
7367
agent,
7468
},
7569
};

0 commit comments

Comments
 (0)