Empty code coverage on transpiled JS code
I am inside a folder that has the below structure src/ -> this has *.js and *.js.map test/ -> this has *.js and *.js.map
I run the command [email protected]/node_modules/c8/bin/c8.js --include src//*.js [email protected]/node_modules/mocha/bin/mocha.js test/unit//*.js --verbose
It does the tests but my coverage report says 0
----------|---------|----------|---------|---------|-------------------
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| All files | 0 | 0 | 0 | 0 | |
| ---------- | --------- | ---------- | --------- | --------- | ------------------- |
=============================== Coverage summary =============================== Statements : Unknown% ( 0/0 ) Branches : Unknown% ( 0/0 ) Functions : Unknown% ( 0/0 ) Lines : Unknown% ( 0/0 )
I tried --src src as well. But nothing worked. Does C8 work for transpiled JS code? How do I debug the above problem?
@gpradeepjain could you provide a repository with a minimal reproduction please 👏
In my case the coverage showed as empty if I killed the running process with ctrl+C. If I run process.exit(0) to terminate the js script, then everything gets picked up