File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77- Updated dev dependencies.
88- Updated ` jsconfig.json ` ` compilerOptions.module ` to ` nodenext ` .
9+ - Fixed the ` fetchGraphQL ` test with the global ` fetch ` API unavailable for new versions of Node.js that have the ` fetch ` global.
910
1011## 18.0.0
1112
Original file line number Diff line number Diff line change @@ -25,18 +25,26 @@ export default (tests) => {
2525 } ) ;
2626
2727 tests . add ( "`fetchGraphQL` with global `fetch` API unavailable." , async ( ) => {
28- deepStrictEqual ( await fetchGraphQL ( "http://localhost" ) , {
29- errors : [
30- {
31- message : "Fetch error." ,
32- extensions : {
33- client : true ,
34- code : "FETCH_ERROR" ,
35- fetchErrorMessage : "Global `fetch` API unavailable." ,
36- } ,
37- } ,
38- ] ,
28+ const revertGlobals = revertableGlobals ( {
29+ fetch : undefined ,
3930 } ) ;
31+
32+ try {
33+ deepStrictEqual ( await fetchGraphQL ( "http://localhost" ) , {
34+ errors : [
35+ {
36+ message : "Fetch error." ,
37+ extensions : {
38+ client : true ,
39+ code : "FETCH_ERROR" ,
40+ fetchErrorMessage : "Global `fetch` API unavailable." ,
41+ } ,
42+ } ,
43+ ] ,
44+ } ) ;
45+ } finally {
46+ revertGlobals ( ) ;
47+ }
4048 } ) ;
4149
4250 tests . add ( "`fetchGraphQL` with a fetch error." , async ( ) => {
You can’t perform that action at this time.
0 commit comments