diff --git a/packages/rtk-query-codegen-openapi/package.json b/packages/rtk-query-codegen-openapi/package.json index 475c23fc34..0ec5f85f49 100644 --- a/packages/rtk-query-codegen-openapi/package.json +++ b/packages/rtk-query-codegen-openapi/package.json @@ -39,6 +39,7 @@ "@types/jest": "^27", "@types/lodash": "^4.14.165", "@types/node": "^14.14.12", + "@types/node-fetch": "^2.6.11", "@types/prettier": "^2.1.6", "@types/semver": "^7.3.9", "babel-jest": "^26.6.3", @@ -49,6 +50,7 @@ "husky": "^4.3.6", "jest": "^29", "msw": "^0.40.2", + "node-fetch": "^2.7.0", "openapi-types": "^9.1.0", "pretty-quick": "^3.1.0", "ts-jest": "^29", diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index b7bd2d4661..716484e647 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -58,6 +58,7 @@ "@types/json-stringify-safe": "^5.0.0", "@types/nanoid": "^2.1.0", "@types/node": "^20.11.0", + "@types/node-fetch": "^2.6.11", "@types/query-string": "^6.3.0", "@types/react": "^18.0.12", "@types/react-dom": "^18.0.5", @@ -81,7 +82,7 @@ "jsdom": "^21.0.0", "json-stringify-safe": "^5.0.1", "msw": "^2.1.4", - "node-fetch": "^3.3.2", + "node-fetch": "^2.7.0", "prettier": "^3.2.4", "query-string": "^7.0.1", "rimraf": "^3.0.2", diff --git a/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx b/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx index 07bda8f612..6160eade9e 100644 --- a/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx +++ b/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx @@ -1003,7 +1003,7 @@ describe('fetchBaseQuery', () => { expect(result?.error).toEqual({ status: 'TIMEOUT_ERROR', - error: 'AbortError: The operation was aborted.', + error: expect.stringMatching(/^AbortError:/), }) }) }) @@ -1121,7 +1121,7 @@ describe('timeout', () => { expect(result?.error).toEqual({ status: 'TIMEOUT_ERROR', - error: 'AbortError: The operation was aborted.', + error: expect.stringMatching(/^AbortError:/), }) }) }) diff --git a/yarn.lock b/yarn.lock index a16121b947..45421bbd33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7428,6 +7428,7 @@ __metadata: "@types/json-stringify-safe": ^5.0.0 "@types/nanoid": ^2.1.0 "@types/node": ^20.11.0 + "@types/node-fetch": ^2.6.11 "@types/query-string": ^6.3.0 "@types/react": ^18.0.12 "@types/react-dom": ^18.0.5 @@ -7452,7 +7453,7 @@ __metadata: jsdom: ^21.0.0 json-stringify-safe: ^5.0.1 msw: ^2.1.4 - node-fetch: ^3.3.2 + node-fetch: ^2.7.0 prettier: ^3.2.4 query-string: ^7.0.1 redux: ^5.0.1 @@ -7719,6 +7720,7 @@ __metadata: "@types/jest": ^27 "@types/lodash": ^4.14.165 "@types/node": ^14.14.12 + "@types/node-fetch": ^2.6.11 "@types/prettier": ^2.1.6 "@types/semver": ^7.3.9 babel-jest: ^26.6.3 @@ -7730,6 +7732,7 @@ __metadata: husky: ^4.3.6 jest: ^29 msw: ^0.40.2 + node-fetch: ^2.7.0 oazapfts: ^4.8.0 openapi-types: ^9.1.0 prettier: ^2.2.1 @@ -8877,6 +8880,16 @@ __metadata: languageName: node linkType: hard +"@types/node-fetch@npm:^2.6.11": + version: 2.6.11 + resolution: "@types/node-fetch@npm:2.6.11" + dependencies: + "@types/node": "*" + form-data: ^4.0.0 + checksum: 180e4d44c432839bdf8a25251ef8c47d51e37355ddd78c64695225de8bc5dc2b50b7bb855956d471c026bb84bd7295688a0960085e7158cbbba803053492568b + languageName: node + linkType: hard + "@types/node@npm:*, @types/node@npm:^17.0.5": version: 17.0.45 resolution: "@types/node@npm:17.0.45" @@ -14101,13 +14114,6 @@ __metadata: languageName: node linkType: hard -"data-uri-to-buffer@npm:^4.0.0": - version: 4.0.1 - resolution: "data-uri-to-buffer@npm:4.0.1" - checksum: 0d0790b67ffec5302f204c2ccca4494f70b4e2d940fea3d36b09f0bb2b8539c2e86690429eb1f1dc4bcc9e4df0644193073e63d9ee48ac9fce79ec1506e4aa4c - languageName: node - linkType: hard - "data-urls@npm:^2.0.0": version: 2.0.0 resolution: "data-urls@npm:2.0.0" @@ -16426,16 +16432,6 @@ __metadata: languageName: node linkType: hard -"fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4": - version: 3.2.0 - resolution: "fetch-blob@npm:3.2.0" - dependencies: - node-domexception: ^1.0.0 - web-streams-polyfill: ^3.0.3 - checksum: f19bc28a2a0b9626e69fd7cf3a05798706db7f6c7548da657cbf5026a570945f5eeaedff52007ea35c8bcd3d237c58a20bf1543bc568ab2422411d762dd3d5bf - languageName: node - linkType: hard - "fflate@npm:^0.7.4": version: 0.7.4 resolution: "fflate@npm:0.7.4" @@ -16789,15 +16785,6 @@ __metadata: languageName: node linkType: hard -"formdata-polyfill@npm:^4.0.10": - version: 4.0.10 - resolution: "formdata-polyfill@npm:4.0.10" - dependencies: - fetch-blob: ^3.1.2 - checksum: 82a34df292afadd82b43d4a740ce387bc08541e0a534358425193017bf9fb3567875dc5f69564984b1da979979b70703aa73dee715a17b6c229752ae736dd9db - languageName: node - linkType: hard - "formik@npm:^2.1.5": version: 2.2.9 resolution: "formik@npm:2.2.9" @@ -22676,13 +22663,6 @@ fsevents@^1.2.7: languageName: node linkType: hard -"node-domexception@npm:^1.0.0": - version: 1.0.0 - resolution: "node-domexception@npm:1.0.0" - checksum: ee1d37dd2a4eb26a8a92cd6b64dfc29caec72bff5e1ed9aba80c294f57a31ba4895a60fd48347cf17dd6e766da0ae87d75657dfd1f384ebfa60462c2283f5c7f - languageName: node - linkType: hard - "node-emoji@npm:^1.10.0": version: 1.10.0 resolution: "node-emoji@npm:1.10.0" @@ -22748,14 +22728,17 @@ fsevents@^1.2.7: languageName: node linkType: hard -"node-fetch@npm:^3.3.2": - version: 3.3.2 - resolution: "node-fetch@npm:3.3.2" +"node-fetch@npm:^2.7.0": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" dependencies: - data-uri-to-buffer: ^4.0.0 - fetch-blob: ^3.1.4 - formdata-polyfill: ^4.0.10 - checksum: 06a04095a2ddf05b0830a0d5302699704d59bda3102894ea64c7b9d4c865ecdff2d90fd042df7f5bc40337266961cb6183dcc808ea4f3000d024f422b462da92 + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 languageName: node linkType: hard @@ -31443,13 +31426,6 @@ fsevents@^1.2.7: languageName: node linkType: hard -"web-streams-polyfill@npm:^3.0.3": - version: 3.3.2 - resolution: "web-streams-polyfill@npm:3.3.2" - checksum: 0292f4113c1bda40d8e8ecebee39eb14cc2e2e560a65a6867980e394537a2645130e2c73f5ef6e641fd3697d2f71720ccf659aebaf69a9d5a773f653a0fdf39d - languageName: node - linkType: hard - "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1"