我使用babel将文件从src传输到lib,当我尝试运行玩笑时,src/Template.js和lib/Template.js之间发生了冲突
Using Jest CLI v0.9.0, jasmine2, babel-jest
Error: Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: Template
Paths: src/Template.js collides with lib/Template.js我们应该如何处理这种情况?有没有办法忽略其中一个目录?
在package.json中:
发布于 2016-03-09 10:28:46
问题是,在默认情况下,jest会搜索整个项目以进行测试。https://facebook.github.io/jest/docs/api.html#config-testpathdirs-array-string
package.json中的解决方案
"jest": {
"testPathDirs": [
"<rootDir>/__tests__", # Default is <rootDir>
"<rootDir>/lib" # Needed for automatic mocking to work
],
...
}https://stackoverflow.com/questions/35886737
复制相似问题