-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use custom jsdom environment instead of patch package to set Response…
… in the environemt (#11751) * fix: use custom jsdom env insted of patching it via patch package * Clean up Prettier, Size-limit, and Api-Extractor * use native `AbortController` (#11753) --------- Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com> Co-authored-by: phryneas <phryneas@users.noreply.github.com>
- Loading branch information
1 parent
91546eb
commit 4cbd229
Showing
5 changed files
with
29 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"dist/apollo-client.min.cjs": 39573, | ||
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32845 | ||
"dist/apollo-client.min.cjs": 39510, | ||
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32799 | ||
} |
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,21 @@ | ||
const { default: JSDOMEnvironment } = require("jest-environment-jsdom"); | ||
|
||
// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string | ||
class FixJSDOMEnvironment extends JSDOMEnvironment { | ||
constructor(...args) { | ||
super(...args); | ||
|
||
// FIXME https://github.com/jsdom/jsdom/issues/1724 | ||
this.global.Headers = Headers; | ||
this.global.Request = Request; | ||
this.global.Response = Response; | ||
|
||
// FIXME: setting a global fetch breaks HttpLink tests | ||
// and setting AbortController breaks PersistedQueryLink tests, which may | ||
// indicate a memory leak | ||
// this.global.fetch = fetch; | ||
this.global.AbortController = AbortController; | ||
} | ||
} | ||
|
||
module.exports = FixJSDOMEnvironment; |
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 was deleted.
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