简体   繁体   English

Karma 和 Angular 中的重点测试出错(failOnSkippedTests)

[英]Error on focused tests in Karma and Angular (failOnSkippedTests)

Is there anyone here who has a working solution for the failOnSkippedTests: true flag in Karma testing with Angular?这里有没有人对 Angular 的 Karma 测试中的failOnSkippedTests: true标志有有效的解决方案?

I tried everything following by https://github.com/karma-runner/karma/issues/3284 .我尝试了https://github.com/karma-runner/karma/issues/3284之后的所有内容。 When I set focused test I got tests skipped and still success.当我设置重点测试时,我跳过了测试,但仍然成功。

I've found in node_modules\karma\lib\browser_collection.js method getResults() which return exitCode: 1 which is ok, so maybe the problem is in Reporter.我在node_modules\karma\lib\browser_collection.js方法getResults()中发现它返回exitCode: 1问题,所以问题可能出在 Reporter 中。 I was trying to set karma-spec-reporter but it didn't work.我试图设置karma-spec-reporter但它没有用。

Any ideas, solutions?任何想法,解决方案?

I use ESLint to lint the spec files with eslint-plugin-jasmine and when you lint the project, it will throw an error on a focused test.我使用 ESLint 通过 eslint-plugin-jasmine 对规范文件进行 lint,当您对项目进行 lint 时,它会在重点测试中抛出错误。

You can find the plugin here: https://www.npmjs.com/package/eslint-plugin-jasmine .你可以在这里找到插件: https://www.npmjs.com/package/eslint-plugin-jasmine

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM