We have an old version of an application done with create-react-app. This is using react-scripts 1.1.5.
I am trying to use Jest with react-testing-library.
When running the specs, I have the following issue:
● Test suite failed to run
/home/mgarcia/projects/v3bitex-implementation/node_modules/apex-web/lib/redux/middlewares/authMiddleware.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import _regeneratorRuntime from 'babel-runtime/regenerator';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Fine. It seems to be complaining about ES6 being used in a node module. So I run the script with the following:
npm run test -- --transformIgnorePatterns "node_modules/apex-web"
This seems to work, until I run into:
● Test suite failed to run
/home/mgarcia/projects/v3bitex-implementation/node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/DOMElement.js: Unexpected token, expected ( (25:10)
23 | try {
24 | return typeof val.hasAttribute === 'function' && val.hasAttribute('is');
> 25 | } catch {
| ^
26 | return false;
27 | }
So it seems I have to exclude another library.
Am I missing something here? Should I manually list every single library that has this issue? Is there a version of react-scripts that automatically handles this without any issues?
I have tried to upgrade to v2, but everything broke miserably.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
We have an old version of an application done with create-react-app. This is using
react-scripts 1.1.5
.I am trying to use Jest with react-testing-library.
When running the specs, I have the following issue:
Fine. It seems to be complaining about ES6 being used in a node module. So I run the script with the following:
npm run test -- --transformIgnorePatterns "node_modules/apex-web"
This seems to work, until I run into:
So it seems I have to exclude another library.
Am I missing something here? Should I manually list every single library that has this issue? Is there a version of react-scripts that automatically handles this without any issues?
I have tried to upgrade to v2, but everything broke miserably.