Я работаю над тестированием реагирующих компонентов с использованием jest и энзима, раньше он работал правильно, но теперь, когда я тестирую, он не проходит весь тестовый случай при использовании этого
"setupFilesAfterEnv": [
"./utils/jestUtils/setupTests.js"
],
и выдает ошибку типа
● Test suite failed to run
TypeError: base intrinsic for Date.prototype.getUTCFullYear exists, but the property is not available.
1 | const Enzyme = require('enzyme');
> 2 | const EnzymeAdapter = require('enzyme-adapter-react-16');
| ^
3 |
4 | Enzyme.configure({ adapter: new EnzymeAdapter() });
5 |
at GetIntrinsic (node_modules/es-abstract/GetIntrinsic.js:209:12)
at callBoundIntrinsic (node_modules/es-abstract/helpers/callBound.js:10:18)
at Object.<anonymous> (node_modules/es-abstract/2015/YearFromTime.js:9:23)
at Object.<anonymous> (node_modules/es-abstract/2015/DayWithinYear.js:5:20)
at Object.<anonymous> (node_modules/es-abstract/2015/DateFromTime.js:7:21)
at Object.<anonymous> (node_modules/es-abstract/es2015.js:22:16)
at Object.<anonymous> (node_modules/es-abstract/es6.js:3:18)
at Object.<anonymous> (node_modules/array.prototype.find/index.js:4:10)
at Object.<anonymous> (node_modules/airbnb-prop-types/src/childrenOfType.js:1:1)
at Object.<anonymous> (node_modules/airbnb-prop-types/src/index.js:8:1)
at Object.<anonymous> (node_modules/airbnb-prop-types/index.js:1:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:3:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/Utils.js:3:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/index.js:2:18)
at Object.<anonymous> (node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:41:27)
at Object.<anonymous> (node_modules/enzyme-adapter-react-16/build/index.js:4:18)
at Object.<anonymous> (utils/jestUtils/setupTests.js:2:23)
at Array.forEach (<anonymous>)
Test Suites: 98 failed, 98 total
Tests: 0 total
Snapshots: 0 total
Time: 44.888s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ***@1.0.0 test: `jest --verbose --colors`
npm ERR! Exit status 1
но когда я изменяю его на
"setupFiles": [
"./utils/jestUtils/setupTests.js"
],
, он работает нормально, и все тестовые примеры проходят