作者:奶油晓生2502876643 | 来源:互联网 | 2022-12-04 13:09
该项目具有客户端应用程序和服务器站点代码,并且在本地构建项目后,它将把所有构建好的资产(包括前端和后端内容)都放入build
目录中,并且包含客户端需要使用的所有静态资产(所有测试用例都是也包括在那里)。
运行后续测试时,由于多个目录中存在重复的手动模拟,Jest将发出如下警告消息。
jest-haste-map: duplicate manual mock found:
Module name: fileMock
Duplicate Mock path: /Users/x/x/x/x/src/resources/webapp/static/__mocks__/fileMock.js
This warning is caused by two manual mock files with the same file name.
Jest will use the mock file found in:
/Users/x/x/x/x/src/resources/webapp/static/__mocks__/fileMock.js
Please delete one of the following two files:
/Users/x/x/x/x/build/classes/webapp/static/__mocks__/fileMock.js
/Users/x/x/x/x/src/resources/webapp/static/__mocks__/fileMock.js
Lorem Ipsum ..
9
"jest": {
"modulePathIgnorePatterns": [
"/build"
]
}
将build
文件夹添加到文件modulePathIgnorePatterns
内部package.json
。
1> Lorem Ipsum ..:
"jest": {
"modulePathIgnorePatterns": [
"/build"
]
}
将build
文件夹添加到文件modulePathIgnorePatterns
内部package.json
。