【发布时间】:2017-12-12 21:20:59
【问题描述】:
Jest 新手作为我的 React / Redux 应用程序测试套件,由于困扰我的应用程序的这个错误,我无法运行 actions 测试:
测试套件无法运行
无法从“setup.js”中找到模块“setupDevtools”
在 Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
在对象。 (node_modules/react-native/jest/setup.js:30:1)
从我的测试文件中删除所有内容会产生同样的错误。这是我的 Jest 配置:
"jest": {
"verbose": true,
"preset": "jest-react-native",
"roots": [
"<rootDir>/src/actions/_tests_"
]
}
这是我的依赖项:
"dependencies": {
"dotenv": "^4.0.0",
"fhirclient": "^0.1.12",
"full-age-calculator": "0.0.4",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"verror": "^1.10.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.7",
"eslint": "^4.12.1",
"eslint-config-cerner": "^1.0.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.5.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^21.2.1",
"jest-react-native": "^18.0.0",
"node-sass": "^4.7.2",
"react-native": "^0.51.0",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.5"
},
我尝试了来自this Github issue page 的一些建议,但没有解决我的问题。
【问题讨论】:
-
我会在那里尝试更多建议,和/或在那里发布您的问题,因为它是相关的,并且会在熟悉该问题的人中获得更多可见性。
标签: javascript reactjs react-native jestjs