如何解决纽约伊斯坦布尔检测不包括所有文件
我想为我的 Angular 12 应用程序生成仪器以与 Cypress 一起使用。我已经使用 yarn add -D nyc
安装了 nyc,因此我的 package.json
文件如下所示:
{
"name": "frontend","version": "0.0.0","scripts": {
"ng": "ng","start": "ng serve --host 0.0.0.0 --port 4200 --disableHostCheck true","build": "ng build","test": "ng test","lint": "ng lint","e2e": "ng e2e"
},"nyc": {
"extension": [
".ts",".tsx"
],"exclude": [
"**/*.d.ts"
],"reporter": [
"html"
],"all": true
},"private": true,"dependencies": {
"@angular/animations": "^12.0.4","@angular/cdk": "^12.0.4","@angular/common": "^12.0.4","@angular/compiler": "^12.0.4","@angular/core": "^12.0.4","@angular/flex-layout": "^12.0.0-beta.34","@angular/forms": "^12.0.4","@angular/material": "^12.0.4","@angular/platform-browser": "^12.0.4","@angular/platform-browser-dynamic": "^12.0.4","@angular/router": "^12.0.4","@fullcalendar/core": "^4.4.2","@fullcalendar/daygrid": "^4.4.2","@material/layout-grid": "^6.0.0","@sentry/angular": "^6.9.0","@sentry/tracing": "^6.9.0","rxjs": "^6.6.3","tslib": "^2.0.0","webpack": "^5.0.0","zone.js": "~0.11.4"
},"devDependencies": {
"@angular-devkit/build-angular": "^12.0.3","@angular-eslint/builder": "12.3.0","@angular-eslint/eslint-plugin": "12.3.0","@angular-eslint/eslint-plugin-template": "12.3.0","@angular-eslint/schematics": "12.3.0","@angular-eslint/template-parser": "12.3.0","@angular/cli": "^12.0.3","@angular/compiler-cli": "^12.0.4","@angular/language-service": "^12.0.4","@cypress/code-coverage": "^3.9.10","@sentry/webpack-plugin": "^1.16.0","@types/jasmine": "~3.6.0","@types/jasminewd2": "~2.0.3","@types/node": "^13.13.19","@typescript-eslint/eslint-plugin": "4.28.2","@typescript-eslint/parser": "4.28.2","cypress": "^8.1.0","eslint": "^7.30.0","eslint-config-prettier": "^8.3.0","eslint-plugin-prettier": "^3.4.0","jasmine-core": "~3.6.0","jasmine-spec-reporter": "~5.0.0","karma": "~6.3.3","karma-chrome-launcher": "~3.1.0","karma-coverage-istanbul-reporter": "~3.0.2","karma-jasmine": "~4.0.0","karma-jasmine-html-reporter": "^1.5.0","nyc": "^15.1.0","prettier": "2.3.2","protractor": "~7.0.0","ts-node": "^8.10.2","typescript": "~4.2.4"
},"resolutions": {
"webpack": "^5.0.0"
}
}
为了生成检测代码,我运行了 npx nyc instrument --compact=false src instrumented
,如 Cypress 文档的 this 页所示。但是,该工具不会为我的所有文件生成检测代码。我的文件结构如下:
.
├── angular.json
├── cypress
│ ├── fixtures
│ ├── integration
│ │ └── login.spec.js
│ ├── plugins
│ │ └── index.js
│ ├── screenshots
│ ├── support
│ │ ├── commands.js
│ │ └── index.js
│ └── videos
│ └── login.spec.js.mp4
├── cypress.json
├── e2e
│ ├── protractor.conf.js
│ ├── src
│ │ ├── app.e2e-spec.ts
│ │ └── app.po.ts
│ └── tsconfig.json
├── instrumented
│ ├── same as /src
├── karma.conf.js
├── package.json
├── src
│ ├── app
│ │ ├── app.component.html
│ │ ├── app.component.scss
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── app-routing.module.ts
│ │ ├── login
│ │ │ ├── login.component.html
│ │ │ ├── login.component.scss
│ │ │ ├── login.component.spec.ts
│ │ │ ├── login.component.ts
│ │ │ └── pw-reset-dialog
│ │ │ ├── pw-reset-dialog.component.html
│ │ │ ├── pw-reset-dialog.component.scss
│ │ │ ├── pw-reset-dialog.component.spec.ts
│ │ │ └── pw-reset-dialog.component.ts
│ │ ├── material.module.ts
│ │ ├── nav
│ │ │ ├── nav.component.html
│ │ │ ├── nav.component.scss
│ │ │ ├── nav.component.spec.ts
│ │ │ └── nav.component.ts
│ │ ├── notfound
│ │ │ ├── notfound.component.html
│ │ │ ├── notfound.component.scss
│ │ │ ├── notfound.component.spec.ts
│ │ │ └── notfound.component.ts
│ │ ├── protected
│ │ │ ├── more directories/components
│ │ ├── pw-reset
│ │ │ ├── pw-reset.component.html
│ │ │ ├── pw-reset.component.scss
│ │ │ ├── pw-reset.component.spec.ts
│ │ │ └── pw-reset.component.ts
│ │ └── shared
│ │ ├── api.service.spec.ts
│ │ ├── api.service.ts
│ │ ├── authconfig.interceptor.ts
│ │ ├── auth.guard.spec.ts
│ │ ├── auth.guard.ts
│ │ ├── auth.service.spec.ts
│ │ ├── auth.service.ts
│ ├── assets
│ │ ├── english_flag.png
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles
│ │ ├── _body.scss
│ │ ├── _button.scss
│ │ ├── _constants.scss
│ ├── styles.scss
│ └── test.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
├── yarn-error.log
└── yarn.lock
在 /instrumented
中结束的唯一文件实际上似乎被检测(即包含 cov_
部分)是 app.component.spec.ts
、environment.prod.ts
、main.ts
、environment.ts
、polyfill.ts
和 .ts
中的一个 /shared
文件。
我有点迷茫,因为我在这些文件中找不到可能表明问题所在的模式,而且我一直在努力寻找解决方案已有一段时间了。任何帮助将不胜感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。