jest.config.js说明
// "jest": "^26.6.3"
var pkgJson = {
"jest":{
"verbose": true, // 层次显示测试套件中每个测试的结果。
"bail": false, //是否显示日志信息
"testEnvironment": "node",//测试环境
"testRegex": "(/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$", //测试用例目录
"moduleFileExtensions": [ //覆盖的文件类型
"ts",
"tsx",
"js"
],
"coveragePathIgnorePatterns": [ //忽略的目录
"/node_modules/",
"/test/"
],
"coverageThreshold": { // 测试报告阀值
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
},
"collectCoverageFrom": [ //测试覆盖文件
"commands/*.{js,ts}",
"libs/*.{js,ts}",
"!libs/pot.js"
]
}
}
更多: https://jestjs.io/zh-Hans/docs/cli