BCS
BCS

Reputation: 78673

Working example of JS code coverage under Bazel?

I have a project using the Bazel build tool with closure_js_library/closure_js_binary/closure_js_test rules for my JS. What I'm working on now is trying to get a code coverage report out of bazel coverage ... for those tests.

Does anyone know of a working example of that I can start from?


A bit of digging shows that closure_js_test is built on top of PhantomJS and there are a number of search results for PhantomJS and "code coverage" that suggest different tools it can be made to work with (in theory) but most of those search results are either old, "I can't get this to work" pleas, "how I hacked this together" posts or some combination of the above. And all of them seem to assume a non-hermetic build/test environment and running a bunch of stuff in random directories (both of which Bazel goes out of it's way to discourage or prevent).


Given enough time I suspect I could cobble something together, but I'd rather avoid that if someone else has already done the work.

Currently the best option, based on feature support for things I expect to need, seems to be JSCover (ignoring the need for Bazel integration) but from what digging I've done, the plumbing I'd need to do to make that work still seems extensive.

Upvotes: 1

Views: 103

Answers (0)

Related Questions