-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Sourcemaps don't work for code executed before tests #5925
Comments
Changing this into a normal I'm not sure of the implications of it, though. @jwbay thoughts? |
Switching it to |
I meant |
Changing Not to muddy the waters, but source maps are also broken inside the test for the more complex scenario that led me to this bug report. I just haven't been able to repro in isolation yet; once i can repro outside of our application I'll add to this report. This change has no effect on that either (which makes sense, since it was already broken anyway). |
Traced the problem with source maps in more complex scenario to manifesting when an error occurs in a JavaScript dependency of a TypeScript file when using |
See #5945. Not sure it's the correct solution, but seemingly works |
Works for me too. I merged this and tested it in my more complex scenario (involving ts-jest) and it seems to also solve that problem (when using the |
Can we reopen this issue, since it's no longer fixed following #6106 |
Sure. We're gonna fix it (somehow) before release, though |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When errors occur in code that executes before actual test code (e.g. all module-level code in the modules being imported by a test), the source code excerpt and stack trace line numbers are reported incorrectly by Jest
If the current behavior is a bug, please provide the steps to reproduce.
Generally, just throw an error in module level code that's imported by a test.
https://github.com/jamietre/jest-source-map-problem/tree/6afd64cf0dfe0fc4d3b3e4f14ccc0bdea6f7787c
What is the expected behavior?
The source map should work
Please mention your node.js, yarn and operating system version.
node@8.9.4
yarn@1.3.2
macOS@10.13.4 (High Sierra)
The text was updated successfully, but these errors were encountered: