Similar to Jest, Typescript, ts-jest: Coverage is slightly incorrect - however the answer there applies to older versions of jest where the mapCoverage option existed.
mapCoverage has now been removed and my impression is that ts-jest should now provide coverage reports that work out of the box.
I have followed the ts-jest documentation to install and run ts-jest:
npm install --save-dev jest typescript ts-jest @types/jest
npx ts-jest config:init
npx jest --coverage --coverageDirectory='coverage'
open coverage/lcov-report/index.ts.html
However I can see that the coverage report generates incorrect maps:

How can I get coverage maps using current ts-jest?
I have tried adding collectCoverage: true to my jest.config.js which has not changed the output.
Have you tried to specify:
"compilerOptions": {
...
"sourceMap": true,
in your tsconfig.json file?
This solved the problem for me.
Versions:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With