我有一个8号角项目,我试图设置一种情况,除非通过一定百分比的代码覆盖率,否则用户无法提交。
我正在使用NX Workspace和Husky在提交之前运行Linting。我想在此基础上进行ng测试,以及我能提供的覆盖率测试的百分比。如果三个都通过,则提交代码。
我现在有这个package.json文件。我该如何添加呢?
"scripts": {
"ng": "ng","nx": "nx","start": "ng serve","build": "ng build","test": "ng test","lint": "nx workspace-lint && ng lint","e2e": "ng e2e","affected:apps": "nx affected:apps","affected:libs": "nx affected:libs","affected:build": "nx affected:build","affected:e2e": "nx affected:e2e","affected:test": "nx affected:test","affected:lint": "nx affected:lint","affected:dep-graph": "nx affected:dep-graph","affected": "nx affected","format": "nx format:write","format:write": "nx format:write","format:check": "nx format:check","update": "ng update @nrwl/workspace","update:check": "ng update","workspace-schematic": "nx workspace-schematic","dep-graph": "nx dep-graph","help": "nx help","storybook": "start-storybook -p 6006","build-storybook": "build-storybook"
},"husky": {
"hooks": {
"pre-commit": "npm run affected:lint"
}
},...