TypeError:运行Jest

时间:2018-10-03 13:49:15

标签: jestjs babel-jest

我正在尝试将Jest添加到我的项目(23.6.0版)中,但是当我尝试运行测试时,它们都失败,并显示此错误消息。 似乎正在尝试使用babel,但我并不十分了解原因和原因。

我尝试遵循指南https://jestjs.io/docs/en/getting-started,并在我的.babelrc文件中添加了“预设”:[“ env”](这不是一个React项目),但是没有结果。

TypeError: Cannot read property 'useBuiltIns' of undefined

  at _default (node_modules/@babel/plugin-proposal-object-rest-spread/lib/index.js:13:32)
  at Function.memoisePluginContainer (node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
  at Function.normalisePlugin (node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
  at node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
      at Array.map (<anonymous>)
  at Function.normalisePlugins (node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
  at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
  at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
  at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)
  at new File (node_modules/babel-core/lib/transformation/file/index.js:135:24)

0 个答案:

没有答案