Istanbul nyc to exclude test files

I am currently getting my test files in the final coverage. Probably because they are sitting next to my components, and do not have their own test folder. How can I exclude them from coverage?

I installed istanbul and nyc and i use mocha .

My script looks like this:

"test": "nyc --reporter=html mocha tools/testSetup.js app/**/*.spec.js || true"

+14
source share
1 answer

That's right, after some digging, I managed to achieve this. I added

"nyc": { "include": "app", - only looks in the app folder "exclude": "**/*.spec.js" }

.json. webpack, , , webpack.config ( ). , .

+21

Source: https://habr.com/ru/post/1669164/


All Articles