【发布时间】:2017-05-26 14:08:05
【问题描述】:
这是我的 package.json:
"jest": {
"cacheDirectory": "/tmp/jestCache",
"scriptPreprocessor": "node_modules/babel-jest",
"modulePaths": [
"<rootDir>/app/static/react/"
],
"moduleDirectories": [
"node_modules",
"app/static/react/app"
],
"testPathDirs": [
"app/static/react/__tests__"
],
"testRegex": "(.*Tests?\\.jsx?)$"
}
当我运行jest --verbose 时,测试运行,但据我所知,除了抛出错误外,没有办法与标准输出进行任何通信。 console.log 本身不存在。我正在使用 jest 16.0.2。我读到最近有一些关于自动模拟和控制台缓冲的变化,但似乎我错过了一些更基本的东西。
否则测试运行良好。
在 OSX Yosemite 上工作,节点 7.4,npm 4.0.5。
【问题讨论】:
标签: reactjs npm jestjs babel-jest