I have created a component library in react which exports all its component in ES6 modules.
For this I have used @babel/plugin-transform-runtime with the below configuration
{
"corejs": 2,
"helpers": true,
"regenerator": true,
"useESModules": true
}
but when i am importing these modules and trying to execute my test case. It throw the following error.
Test suite failed to run
C:\<project-path>\node_modules\@babel\runtime-corejs2\helpers\esm\extends.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import _Object$assign from "../../core-js/object/assign";
^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)
at Object.<anonymous> (node_modules/<component-library-path>/Anchor.js:1:1)
Can someone please have a look into it.