Closed Bug 1220811 Opened 9 years ago Closed 9 years ago

Basic code coverage tests for WebExtensions

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Iteration:
45.1 - Nov 16

People

(Reporter: kmag, Assigned: kmag)

References

Details

Attachments

(1 file)

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.
Blocks: 1185459
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Looks like bug 1191289 and bug 1204554 may give us a better option for a longer term solution.
Depends on: 1224961
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: