Skip to content
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

Have Jests console respect sourcemaps. #4227

Closed
GeeWee opened this issue Aug 9, 2017 · 5 comments
Closed

Have Jests console respect sourcemaps. #4227

GeeWee opened this issue Aug 9, 2017 · 5 comments

Comments

@GeeWee
Copy link

GeeWee commented Aug 9, 2017

Do you want to request a feature or report a bug? Feature,

What is the current behavior?
When transpiling code from other languages (e.g. typescript) to Jest, the line numbers printed in the terminal are off. It'd be nice if Jest would respect sourcemaps and print the actual line numbers.

An example of this: kulshekhar/ts-jest#283

@cpojer
Copy link
Member

cpojer commented Aug 24, 2017

See #3458

@cpojer cpojer closed this as completed Aug 24, 2017
@GeeWee
Copy link
Author

GeeWee commented Sep 5, 2017

Sorry for reopening, but source map support only works for stack traces, and not console statements (it is the same approach we use in ts-jest)

@CoreyCole
Copy link

CoreyCole commented Aug 13, 2019

I was still having this issue today (jest v24.8.0 and ts-jest 24.0.2). My console log statements were reporting incorrect line numbers. Running jest with --no-cache fixed the issue for me:

jest --no-cache --runTestsByPath ./__tests__/e2e/*_test.ts

Sorry to bump this issue, but hopefully helpful to anyone googling around...

Related to kulshekhar/ts-jest#283 and evanw/node-source-map-support#186

@SimenB
Copy link
Member

SimenB commented Aug 14, 2019

This has been fixed in Jest for quite some time (since #5594 which was released in 22.4.1 18 months ago). Dunno what ts-jest does, but this repo is not really the place to discuss it 🙂 As long as correct source maps are provided by the transformer (and nothing funky is done to console.log and friends) it should just work ™

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants