简体   繁体   English

伊斯坦布尔纽约市将包括测试文件

[英]Istanbul nyc to include test files

I'm currently testing my coverage with mocha and nyc and I noticed some of my assert calls weren't being called. 我目前正在使用mocha和nyc测试我的覆盖范围,我注意到某些断言调用没有被调用。 How can I include my test files in nyc to make sure all the asserts are covered? 如何将测试文件包含在nyc中,以确保覆盖所有断言?

I tried: 我试过了:

"nyc": {
  "include": ["**/*.js"]
},

to include every file in the project and 包括项目中的每个文件,以及

"nyc": {
  "include": ["test/*.js"]
},

to explicitly include the test files, however neither of these included the test files. 明确包含测试文件,但是这些都不包含测试文件。

How do I include the test files or what is the better way of ensuring all the assert statements are covered? 如何包含测试文件,或者确保覆盖所有assert语句的更好方法是什么?

Tests are excluded in exclude, if you provide an empty exclude it will not exclude the tests 测试排除在排除中,如果您提供空白排除,则不会排除测试

"nyc": {
  "exclude": []
}

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

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