Closed Bug 1220811 Opened 5 years ago Closed 5 years ago
Basic code coverage tests for Web
45.1 - Nov 16
It would be nice to have some basic code coverage tests for WebExtensions. There's been some work to add broad JS code coverage tests to mozilla-central, but it looks like that's still a long way off. I've looked at a few tools, and it looks like, of the widely-used options, this will probably be the easiest one to adapt to our test environment: https://github.com/gotwarlost/istanbul
So far, the coverage is much better than I expected: https://people.mozilla.org/~kmaglione/webextension-text-coverage/ The attached patch is a bit of a hack, so I'm not going to try to land id. I may try to land a cleaner version later on. To make this work, I manually instrumented the web extension scripts in my objdir, and then generated a report from the output files after running the webextension tests.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
This is now broken down into three test sets, for all code, parent process code, and content process code: https://people.mozilla.org/~kmaglione/webextension-test-coverage/ https://people.mozilla.org/~kmaglione/webextension-test-coverage/default/ https://people.mozilla.org/~kmaglione/webextension-test-coverage/content/ Generated by this patch: https://people.mozilla.org/~kmaglione/webext-coverage.patch
You need to log in before you can comment on or make changes to this bug.