From e9892c2a10d1a65b2f74f805f7213a1ac91c11f0 Mon Sep 17 00:00:00 2001 From: Nandor Kraszlan Date: Fri, 12 Apr 2024 11:10:30 +0100 Subject: [PATCH] test: remove fetch polyfill for node --- package-lock.json | 52 --------------------------------------------- package.json | 1 - tests/setupTests.ts | 9 -------- 3 files changed, 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef3e58ad..23c2d1cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,6 @@ "@typescript-eslint/parser": "^7.6.0", "commitlint": "^19.2.1", "conventional-changelog-conventionalcommits": "7.0.2", - "cross-fetch": "^4.0.0", "eslint": "^8.23.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^28.2.0", @@ -4906,15 +4905,6 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -10184,48 +10174,6 @@ "node": ">=18" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", diff --git a/package.json b/package.json index 16154bdd..375cc1b3 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,6 @@ "@typescript-eslint/parser": "^7.6.0", "commitlint": "^19.2.1", "conventional-changelog-conventionalcommits": "7.0.2", - "cross-fetch": "^4.0.0", "eslint": "^8.23.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^28.2.0", diff --git a/tests/setupTests.ts b/tests/setupTests.ts index f40227bd..9040bcda 100644 --- a/tests/setupTests.ts +++ b/tests/setupTests.ts @@ -1,15 +1,6 @@ import GlobalConfig from '../src/Support/GlobalConfig'; import type Configuration from '../src/Contracts/Configuration'; import { beforeEach, jest } from '@jest/globals'; -// for some reason global.Promise not found when referenced within node-fetch -global.Promise = globalThis.Promise; -// eslint-disable-next-line @typescript-eslint/no-redeclare -import fetch, { Response, Headers, Request } from 'cross-fetch'; - -globalThis.fetch = fetch; -globalThis.Response = Response; -globalThis.Headers = Headers; -globalThis.Request = Request; /* eslint-disable-next-line @typescript-eslint/consistent-generic-constructors */ export const config: GlobalConfig = new GlobalConfig;