Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Switch test coverage to use Istanbul #5161
OK, so I'm probably the only person who ever uses our coverage tool, but it's something I make use of heavily when refactoring or writing new components that lend themselves to being tested. I don't employ a minimum coverage level or anything like that - some code needs heavy coverage, some doesn't.
If you checkout this PR and run
The blanket test coverage we are using currently has a couple of issues. 1) I'm not a fan of the html-cov format, I much prefer lcov. 2) any test which failed during the coverage prevented any coverage from being generated at all 3) it was hard to figure out what was failing. So the coverage had been broken for a while and hadn't been fixed. I was commenting out the inclusion of
Switching over to istanbul means we get lcov by default. It also shows the tests that fail. If you run
* The current suite of tests depends on having certain cleanup tasks run between each suite, which is currently all handled by grunt. When running the tests through istanbul those cleanup tasks don't happen. That and other issues (timing/async things I guess) mean that the tests don't pass reliably. This certainly needs looking at, but it's not high priority.
There is a separate issue about doing something to generate these reports with the travis build here: #2029
Apr 21, 2015
1 check passed
Just to document this bit somewhere. With this change you can now run
Open that file in a browser and you'll get a lovely coverage table like this:
So if you're working on an area like the helpers or importer that need good coverage, you can drill down to see any code branches that are missing tests. It doesn't take into account configuration branches like subdirectories which often trip us up, but it is a good start.