Jest遇到意外的令牌SyntaxError:意外的令牌{

时间:2019-02-11 04:32:43

标签: reactjs unit-testing jestjs babel enzyme

嗨,我正在使用jest +酶对reactjs应用程序进行单元测试,并将我公司拥有的JavaScript(ES6)库作为node_modules,在转换这些node_modules时,它抛出了错误提示 enter image description here enter image description here 在导入“ {”

时抛出错误

我正在使用以下作为玩笑的变压器: enter image description here

我正在使用以下笑话配置: enter image description here

下面是我的babel.config.js: enter image description here 以下是我的依赖项:   “ babel-core”:“ 7.0.0-bridge.0”,  “ @ babel / core”:“ ^ 7.2.2”,   “ @ babel / preset-env”:“ ^ 7.3.1”,     “ @ babel / preset-react”:“ ^ 7.0.0”,     “ @ babel / preset-typescript”:“ ^ 7.1.0”,  “ babel-jest”:“ ^ 23.6.0”,     “ babel-loader”:“ ^ 7.1.5”,   “ enzyme”:“ ^ 3.3.0”, “ jest”:“ ^ 23.6.0”, “ ts-jest”:“ 23.10.5”,

请告知我是否丢失任何东西,或者需要什么babel插件/预设来摆脱此错误。

0 个答案:

没有答案
相关问题