gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Analyzing coverage of node server in Windows #943

Closed zeeshanr97 closed 1 year ago

zeeshanr97 commented 3 years ago

Creates a coverage folder in the root directory but doesn't generate any files

in package.json:

"scripts": { "start": "node server.js", "test": "istanbul cover server.js" },

in cmd : npm test

I ran test cases to test the server while running the coverage analyzer, the server runs fine but no coverage file generation occurs.

fatemeh-fo commented 1 year ago

npm install --save-dev nyc "scripts": { "start": "node server.js", "test": "nyc --reporter=lcov --report-dir=coverage node server.js" } npm test