Jest没有在React项目中运行

时间:2019-06-18 08:03:33

标签: reactjs jestjs babel

我收到以下错误:

  

测试套件无法运行

Plugin/Preset files are not allowed to export objects, only functions. In
     

D:\ final-repo \ ISGCustomerPortalClientSide \ node_modules \ babel-preset-react \ lib \ index.js

关于为什么Jest无法运行的任何想法?我读到它与babel有关,但我没能把握原因。

  "devDependencies": {
    "autoprefixer": "7.1.4",
    "babel-cli": "6.26.0",
    "babel-core": "6.26.3",
    "babel-eslint": "7.2.3",
    "babel-jest": "20.0.3",
    "babel-loader": "7.1.1",
    "babel-plugin-transform-react-constant-elements": "6.23.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.6",
    "babel-polyfill": "6.23.0",
    "babel-preset-env": "1.7.0",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-1": "6.24.1",
    "browser-sync": "2.26.7",
    "chalk": "2.0.1",
    "concurrently": "3.5.0",
    "connect-history-api-fallback": "1.3.0",
    "coveralls": "3.0.4",
    "css-loader": "3.0.0",
    "enzyme": "3.9.0",
    "enzyme-adapter-react-16": "1.12.1",
    "eslint": "4.2.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-react": "7.3.0",
    "eslint-watch": "5.1.2",
    "extract-text-webpack-plugin": "4.0.0-beta.0",
    "file-loader": "1.1.11",
    "hard-source-webpack-plugin": "0.7.4",
    "history": "4.6.0",
    "html-webpack-plugin": "3.2.0",
    "identity-obj-proxy": "3.0.0",
    "jest": "24.8.0",
    "jest-cli": "24.8.0",
    "json-loader": "0.5.4",
    "mock-local-storage": "1.0.5",
    "mockdate": "2.0.1",
    "node": "8.9.4",
    "node-sass": "4.11.0",
    "opn-cli": "3.1.0",
    "postcss-loader": "2.0.6",
    "prompt": "1.0.0",
    "prop-types": "15.5.10",
    "raf": "3.3.2",
    "react-hot-loader": "4.0.1",
    "react-test-renderer": "16.0.0",
    "redux-immutable-state-invariant": "2.0.0",
    "redux-mock-store": "1.3.0",
    "replace": "1.1.0",
    "rimraf": "2.6.1",
    "sass-loader": "6.0.6",
    "style-loader": "0.21.0",
    "url-loader": "1.0.1",
    "webpack": "4.6.0",
    "webpack-bundle-analyzer": "3.3.2",
    "webpack-dev-middleware": "3.1.3",
    "webpack-hot-middleware": "2.22.1",
    "webpack-md5-hash": "0.0.6"
  },

0 个答案:

没有答案