-
-
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
Sourcemap support for preprocessors? #1474
Comments
Can you try to modify the sample preprocessor again and run Jest with Unfortunately we don't currently have an official typescript preprocessor (besides the example). If you'd like to work on this and send a pull request for adding I'm closing this for now because we can't really do much if it isn't part of Jest. |
I tried this with I tested the sample preprocessor and it seems to be working well with the added flags. The transpiled code contains the sourcemap inline. This leads me to assume that whatever work needs to be done to display the correct (mapped) line numbers will probably need to be done in the Jest code that uses the preprocessor. Is this assumption right? If so, can you point to the part of the codebase (a quick, rough indication would be helpful too) that I can look at to see if I can submit a usable PR? |
Are inline sourcemaps supposed to work automatically when using node and when using the All of this code is in packages/jest-runtime – transform.js creates If you are willing to help out, please join our discord channel (see https://facebook.github.io/jest/support.html ) – I'm usually there and happy to help. Creating |
Upon looking into this, I've discovered that node doesn't have any native support for sourcemaps. Without sourcemap support, creating I've been trying to see if I can get https://github.com/evanw/node-source-map-support to work with the typescript preprocessor. If I can, I'll create |
Can typescript somehow retain lines, just like babel can? |
There's no such option in the typescript compiler |
ah that sucks :( |
Just in case there's someone else with this problem, I've created a repo with information about the setup that's working for me - https://github.com/kulshekhar/typescript-jest Edit: the repo is at https://github.com/kulshekhar/ts-jest and the |
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. |
When used with typescript, the output displays line numbers from transpiled javascript and not from the actual typescript code.
I've modified this sample typescript preprocessor to set
sourceMap
,inlineSourceMap
andinlineSources
to true in typescript's options but it didn't help.Is there anything else that I can do to get jest to display the mapped line numbers?
The text was updated successfully, but these errors were encountered: