Coverage breaks sourcemaps
See original GitHub issueIssue :
If user enables test coverage with Jest then the sourcemaps are not correct.
Expected behavior :
Lines should be shown correctly, even if developer enables coverage report with Jest.
Minimal repo :
Github project: https://github.com/maxpolski/ts-react-jest/ Please kindly note that this is NOT my repository Run jest with coverage option. You will notice that the sourcemaps are not working correctly. To make sure, you can add console.log() in any React component and compare the line where console.log occured with the one displayed in the jest output. Interestingly, sourcemaps work absolutely fine in test files, but not in source files.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:28
- Comments:11
Top Results From Across the Web
Karma Webpack sourcemaps not working - Stack Overflow
One solution is to configure karma and webpack to skip code coverage instrumentation when running tests in watch mode.
Read more >source-map-loader - webpack
The source-map-loader extracts existing source maps from all JavaScript entries. This includes both inline source maps as well as those linked via URL....
Read more >4 Reasons Why Your Source Maps are Broken - Sentry Blog
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >source-map | Yarn - Package Manager
Generates and consumes source maps ... Build Status. Coverage Status. NPM. This is a library to generate and consume the source map format...
Read more >JavaScript Debugging with Sourcemaps - TrackJS
A sourcemap is a mapping between the generated/transpiled/minified JavaScript file and one or more original source files. The main purpose of sourcemaps is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was fixed in
23.1.2
, see . But reproducible in:jest 24.9.0
+ts-jest 24.0.2
jest 23.6.0
+ts-jest 23.10.5
(latest 23.* versions as of today)Workaround for debugging:
collectCoverage
from config--coverage
to jest cli intest
script ofpackage.json
:I confirmed that this was the cause of my inability to debug tests via vscode-jest. Turning off code coverage allowed the sourcemaps to be built properly.