-
Notifications
You must be signed in to change notification settings - Fork 92
Invalid coverage with --experimental-monocart
when using ts-node
#561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I guess this is because runtime JS files are transformed on the fly, and Monocart does not have access to those? |
I thought it should be the issue with the sourcemap. npm run test
> mcr-ts-node@1.0.0 test
> cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr ts-node ./test/example.test.ts -o coverage-reports/ts
[MCR] Execute: ts-node ./test/example.test.ts
[MCR] Loaded: mcr.config.ts
hello
[MCR] Coverage Report
┌──────────────┬─────────┬────────────┬──────────┬───────────┬─────────┬─────────────────┐
│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │
├──────────────┼─────────┼────────────┼──────────┼───────────┼─────────┼─────────────────┤
│ src │ │ │ │ │ │ │
│ └ example.ts │ 79.28 % │ 75.00 % │ 62.50 % │ 100.00 % │ 53.85 % │ 2-4,12-14 │
├──────────────┼─────────┼────────────┼──────────┼───────────┼─────────┼─────────────────┤
│ Summary │ 79.28 % │ 75.00 % │ 62.50 % │ 100.00 % │ 53.85 % │ │
└──────────────┴─────────┴────────────┴──────────┴───────────┴─────────┴─────────────────┘ But I haven't figured out why c8 isn't working. The differences: |
That example is not using |
yes, I haven't figured out why c8 isn't working |
I have found that the issue is related to the generated source code. when using In order to get the generated code, |
Yep, that's exactly what I meant by #561 (comment). |
All metrics of coverage report are incorrectly set to 100% when using
--experimental-monocart
withts-node
.Repro, make sure you download the project locally as WebContainers do not support V8 coverage/CDP: https://stackblitz.com/~/edit/c8-ts-node-invalid-monocart
The text was updated successfully, but these errors were encountered: