forked from googleapis/release-please
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
161 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// nock, used to mock HTTP requests, currently does not support the undici network stack from node v18+. As a | ||
// consequence node native fetch isn't supported either and won't be intercepted. | ||
// See https://github.com/nock/nock/issues/2183 and https://github.com/nock/nock/issues/2397. | ||
// | ||
// This file replace the native fetch by the polyfill node-fetch when node v18 is run with the flag | ||
// --no-experimental-fetch. That's only intended as a temporary solution, the experimental flag is expected to be | ||
// removed starting from node v22. | ||
import fetch, {Headers, Request, Response} from 'node-fetch'; | ||
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
if (!globalThis.fetch) { | ||
(globalThis as any).fetch = fetch; | ||
(globalThis as any).Headers = Headers; | ||
(globalThis as any).Request = Request; | ||
(globalThis as any).Response = Response; | ||
} |