Sign in
Log inSign up

ExpressJs: Istanbul coverage report with mocha

Atul Joshi's photo
Atul Joshi
·Apr 16, 2017

I tried to get a coverage report for my test cases, and installed istanbul, My coverage report works fine for a single test file that is in root folder, else I get “No coverage information was collected, exit without writing coverage information”

My folder structure is

app/ 
 — node_modules/
 — coverage/
 — server/
 — —  app.js
 — test/
 — — index.test.js
 — test.js

When I run

istanbul cover _mocha test.js

I get a coverage report however If I try to tun

istanbul cover _mocha test/*.js

or

istanbul cover _mocha test/index.test.js

I don’t get any coverage report I tried all hit and trial its not working any work around for the same?

How can I run istanbul to cover report for all the test cases recursively ?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct