-
Notifications
You must be signed in to change notification settings - Fork 459
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
line number is mismatch when use console.log #283
Comments
@m0a would it be possible for you to create a minimal repo with only the test project? |
sorry. create repo. |
@m0a thanks On testing, I got the same output as you did. The line number for What's confusing is that the other line numbers are correctly shown. I'll try to take a closer look at this |
ts-jest uses source-map-support to ensure that the line numbers are correct. source-map-support only takes care of the stack traces related to errors. That's why error related stack traces have the correct line numbers while |
I've closed this for now but if you think this can be fixed here, this issue can be reopened. |
I think maybe we'll be able to patch the console the same way source-map support patches the error logs. At the minimum we need to document this somewhere. |
@GeeWee I'm not sure a patch for this issue belongs in ts-jest. If we're doing this, it might be better to do it in a new project which can then be used from ts-jest. Thoughts? As an aside, the last time I had checked (quite some time back), source-map-support only worked with nodejs that used V8 |
That's definitely a good idea. Maybe source-map-support would be interested? |
I have raised the issue in evanw/node-source-map-support#186 |
I have also raised the issue in the jest repo. |
Thanks for pursuing this @GeeWee, this is a big annoyance! |
Closing as there's nothing we can do about this in ts-jest |
thank you for great tool!
i use console.log in test code.
but line number mismatch.
i created test project. here https://github.com/m0a-mystudy/typescript/blob/master/jest-line-number/line-number.test.ts
out put is here
output
console.log line-number.test.ts:14
line number mismatch. why?
The text was updated successfully, but these errors were encountered: