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
Last Resolved: 3 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.