Merge pull request #18234 from backstage/blam/jsdom-env

cli: Add `Request` `Response` `Headers` and `fetch` to `jsdom` environment
This commit is contained in:
Fredrik Adelöw
2023-06-20 10:40:26 +02:00
committed by GitHub
128 changed files with 25 additions and 186 deletions
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -50,7 +50,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -37,7 +37,6 @@ describe('The production Airbrake API', () => {
);
const groups = await productionApi.fetchGroups('123456');
expect(groups).toStrictEqual(mockGroupsData);
});
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -49,7 +49,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -49,7 +49,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
// eslint-disable-next-line no-restricted-imports
import { TextEncoder } from 'util';
@@ -46,7 +46,6 @@
"@types/jest": "^28.1.3",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
// eslint-disable-next-line no-restricted-imports
import { TextEncoder } from 'util';
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -47,7 +47,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -58,7 +58,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -60,7 +60,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
+1 -2
View File
@@ -51,8 +51,7 @@
"@backstage/dev-utils": "workspace:^",
"@backstage/test-utils": "workspace:^",
"@testing-library/jest-dom": "^5.16.5",
"@types/node": "^16.11.26",
"cross-fetch": "^3.1.5"
"@types/node": "^16.11.26"
},
"files": [
"dist"
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
+1 -2
View File
@@ -51,8 +51,7 @@
"@backstage/cli": "workspace:^",
"@backstage/dev-utils": "workspace:^",
"@testing-library/jest-dom": "^5.10.1",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5"
"@types/react": "^16.13.1 || ^17.0.0"
},
"files": [
"dist"
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -31,7 +31,6 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"cross-fetch": "^3.1.5",
"lodash": "^4.17.21",
"luxon": "^3.0.0",
"qs": "^6.9.6",
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -69,7 +69,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -89,7 +89,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/jwt-decode": "^3.1.0",
"@types/zen-observable": "^0.8.0",
"cross-fetch": "^3.1.5",
"react-test-renderer": "^16.13.1"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
@@ -44,7 +44,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
+1 -2
View File
@@ -70,8 +70,7 @@
"@testing-library/dom": "^8.0.0",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"cross-fetch": "^3.1.5"
"@testing-library/user-event": "^14.0.0"
},
"files": [
"dist"
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -51,7 +51,6 @@
"@types/luxon": "^3.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -17,4 +17,3 @@
/* eslint-disable @backstage/no-undeclared-imports */
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -57,7 +57,6 @@
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"@types/recharts": "^1.8.15",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -49,7 +49,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -52,7 +52,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -56,7 +56,6 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -63,7 +63,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -50,7 +50,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -57,7 +57,6 @@
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"@types/sanitize-html": "^2.6.2",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -54,7 +54,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/recharts": "^1.8.15",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -54,7 +54,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -52,7 +52,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
@@ -63,7 +63,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -61,7 +61,6 @@
"@types/luxon": "^3.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -48,7 +48,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -70,7 +70,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react-grid-layout": "^1.3.2",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -55,7 +55,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -52,7 +52,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"jest-when": "^3.1.0",
"msw": "^1.0.0"
},
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -71,7 +71,6 @@
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -16,7 +16,6 @@
import '@testing-library/jest-dom';
// eslint-disable-next-line no-restricted-imports
import { TextDecoder, TextEncoder } from 'util';
import 'cross-fetch/polyfill';
// These are missing from jest-node, so not available on global.
Object.defineProperty(global, 'TextEncoder', {
-1
View File
@@ -62,7 +62,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -58,7 +58,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -72,7 +72,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
+1 -2
View File
@@ -41,8 +41,7 @@
"@backstage/cli": "workspace:^",
"@backstage/dev-utils": "workspace:^",
"@testing-library/jest-dom": "^5.10.1",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5"
"@types/react": "^16.13.1 || ^17.0.0"
},
"files": [
"dist"
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -48,7 +48,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -57,7 +57,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -61,7 +61,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -63,7 +63,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -52,7 +52,6 @@
"@types/luxon": "^3.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -64,7 +64,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0",
"swr": "^2.0.0"
},
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -59,7 +59,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.1"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -108,7 +108,6 @@
"@types/humanize-duration": "^3.18.1",
"@types/json-schema": "^7.0.9",
"@types/node": "^16.11.26",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,7 +15,6 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
const { EventSourcePolyfill } = jest.requireMock('event-source-polyfill');
global.EventSource = EventSourcePolyfill;
-1
View File
@@ -66,7 +66,6 @@
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"cross-fetch": "^3.1.5",
"history": "^5.0.0",
"msw": "^1.0.0"
},
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -52,7 +52,6 @@
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"@types/zen-observable": "^0.8.2",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -62,7 +62,6 @@
"@types/luxon": "^3.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"configSchema": "config.d.ts",
-1
View File
@@ -15,4 +15,3 @@
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';
-1
View File
@@ -58,7 +58,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
"files": [
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/jest-dom';
import 'cross-fetch/polyfill';

Some files were not shown because too many files have changed in this diff Show More