Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 使用preact、Jest和enzyme的意外令牌测试用例错误_Reactjs_Jestjs_Babel Jest_Preact - Fatal编程技术网

Reactjs 使用preact、Jest和enzyme的意外令牌测试用例错误

Reactjs 使用preact、Jest和enzyme的意外令牌测试用例错误,reactjs,jestjs,babel-jest,preact,Reactjs,Jestjs,Babel Jest,Preact,我在单元测试用例中使用Preact、jest和enzyme,但在运行测试用例时,我面临以下问题 测试套件无法运行 node_modules/**/components/dd/index.jsx:1 ({“Object.”:函数(模块,导出,require,uu dirname,uu filename,global,jest){import{h,Component}来自'preact'; ^ SyntaxError:意外标记{ 在新脚本中(vm.js:85:7) 在对象上。(/components

我在单元测试用例中使用Preact、jest和enzyme,但在运行测试用例时,我面临以下问题

测试套件无法运行

node_modules/**/components/dd/index.jsx:1 ({“Object.”:函数(模块,导出,require,uu dirname,uu filename,global,jest){import{h,Component}来自'preact'; ^

SyntaxError:意外标记{

在新脚本中(vm.js:85:7) 在对象上。(/components//index.jsx:2:43)

我在下面提到了设置jest脚本的repo: