However, you may have also noticed that our step definitions are showing up in our coverage report. Istanbul is not smart enough to figure out that our step definition files are part of the tests, and not the code; therefore, we need to manually instruct Istanbul to ignore them. We can do with by adding a .nycrc file and specifying the exclude option:
{
"exclude": [
"coverage/**",
"packages/*/test/**",
"test/**",
"test{,-*}.js",
"**/*{.,-}test.js"
,"**/__tests__/**",
"**/node_modules/**",
"dist/",
"spec/",
"src/**/*.test.js"
]
}
Now, when we run the test:coverage script, the step definition files are excluded from the results. All that's left to do is commit our code!
$ git add -A && git commit -m "Implement coverage for all tests"