Chore: Add whatwg-fetch polyfill to admin-test-utils

This commit is contained in:
Gustav Hansen 2023-02-20 12:23:47 +01:00
parent e4c0d0bf19
commit e86facb7bd
4 changed files with 12 additions and 1 deletions

View File

@ -43,6 +43,7 @@ module.exports = {
globalSetup: '<rootDir>/test/config/front/global-setup.js',
setupFiles: [
'<rootDir>/packages/admin-test-utils/lib/setup/test-bundler.js',
'<rootDir>/packages/admin-test-utils/lib/mocks/fetch.js',
'<rootDir>/packages/admin-test-utils/lib/mocks/LocalStorageMock.js',
'<rootDir>/packages/admin-test-utils/lib/mocks/IntersectionObserver.js',
'<rootDir>/packages/admin-test-utils/lib/mocks/ResizeObserver.js',

View File

@ -0,0 +1,4 @@
'use strict';
// Required as long as we are running tests on node@14 and node@16
require('whatwg-fetch');

View File

@ -24,7 +24,8 @@
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"redux": "^4.2.1",
"styled-components": "5.3.3"
"styled-components": "5.3.3",
"whatwg-fetch": "3.6.2"
},
"peerDependencies": {
"redux": "^4.2.1"

View File

@ -22579,6 +22579,11 @@ whatwg-encoding@^2.0.0:
dependencies:
iconv-lite "0.6.3"
whatwg-fetch@3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c"
integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==
whatwg-mimetype@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7"