DEV Community

Discussion on: Testing Your Deno Apps With Mocha

Collapse
 
ynwd profile image
ynwd

any info on the use of code coverage in deno?

Collapse
 
hardy613 profile image
Scott Hardy

deno test --coverage --unstable :)))

Collapse
 
craigmorten profile image
Craig Morten

Hey @ynwd 👋

I'm not 100% sure r.e. code coverage using Mocha - most people tend to use Istanbul for coverage with Mocha, but I'm not familiar with a browser-only compatible setup (i.e. no Node) - there appears to be an issue with some useful details on the Instanbul GitHub Issues with may be of use? There may be other 3rd party libs that can perform in browser code coverage that are compatible with Mocha which would then likely also work with Deno.

With respect to Deno itself, from what I've heard code coverage is currently being worked on - check out Deno GitHub Issue. Some PoCs have been done already (e.g. see here). There is also this PR which is still in draft and slated for the Deno 1.4.0 release which will add a --coverage flag to the deno test command so fingers crossed built-in coverage support may be released over the next few months.

Collapse
 
lu4 profile image
Denis Yaremov