Sourcemaps break error reporting in Jest
See original GitHub issueSourcemaps seem to break error reporting in Jest. Every time TypeORM throw an error while running tests with Jest I get something like this:
ENOENT: no such file or directory, open '/Users/timon/Projects/typeorm-jest-bug/src/metadata-builder/EntityMetadataValidator.ts'
Removing the sourcemap for EntityMetadataValidator.ts
seems to fix the problem. It also only happens in Jest, when I run the code in Node it works perfectly fine.
I made a repository as to easily reproduce the bug: https://github.com/TimonVS/typeorm-jest-bug
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Coverage breaks sourcemaps #917 - kulshekhar/ts-jest - GitHub
Issue : If user enables test coverage with Jest then the sourcemaps are not correct. Expected behavior : Lines should be shown correctly, ......
Read more >TypeScript debugging with Visual Studio Code
TypeScript debugging supports JavaScript source maps. To generate source maps for your TypeScript files, compile with the --sourcemap option or set the ...
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 >Jest + Babel: Debugger stops on a wrong line : WEB-27680
Whenever I debug a Jest unit test with transpiled es6 with sourcemaps using babel, there are substantial problems setting breakpoints that actually work...
Read more >Why does the stack trace for my jest tests point to the wrong ...
It has to do with source maps. If those are not correctly generated or processed, the debugger will show the wrong line. I...
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 Free
Top 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
I’m no Jest expert but your test repo gets fixed by downgrading
jest
andts-jest
to versions21.x.x
Try to isolate whether it’s due to
ts-jest
orjest
and file an issue over there.Thank you @hmil !