You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty new to TypeScript/jest and I spent hours in figuring out why line numbering in failing tests are wrong so please bear with me.
I'm not sure if I missed something or it's an actual bug and I couldn't find anything close to my problem online. When running install(), line numbering breaks, when commenting it out, everything works fine (but of course stack traces don't work any more). It doesn't matter if install() is run in test code or in imported production code, test line numbering always breaks.
Activity
LinusU commentedon May 25, 2020
Did it work with 0.5.18? 🤔
schw4rzlicht commentedon May 25, 2020
I just tested 0.5.0 and 0.5.18 and they both have the same problem.
[-]0.5.19 breaks jest source maps[/-][+]Jest source maps not working[/+]andinoJamesV commentedon May 30, 2020
Possibly related and probably not this Libs issue istanbuljs/nyc#1323 as Jest uses Istanbul nyc.
Any suggestions?
Also this error is occurring with nyc that is strange
Verified that register.js is where it is expected
My suspicion is mix and match CJS and ES module types are the problem?
Lib is working with just mocha though
andinoJamesV commentedon May 30, 2020
So I kept digging into the project and code coverage is built into V8
schw4rzlicht commentedon Jun 2, 2020
@Heavy-Gray I'm not sure how I could actually help.
Where does that suspicion come from? Did you have a look at the sample I linked above? Do you mean b/c of
{ "compilerOptions": { "esModuleInterop": true } }https://github.com/schw4rzlicht/node-sourcemap-jest-demo/blob/master/tsconfig.json
andinoJamesV commentedon Jun 2, 2020
@schw4rzlicht No for sure you can`t I was bouncing around broken libraries and by chance this lib and thread came up.
Just to verify node-source-map-support is working and the problem you are having is in nyc or Jest
schw4rzlicht commentedon Jun 4, 2020
Yes. Debugging and stack traces have the right line numbers outside of Jest tests.
fix: Fix line numbers being wrong in index tests (see evanw/node-sou…
chore(release): 1.13.0-rc.1 [skip ci]
chore(release): 1.13.0 [skip ci]
dmaretskyi commentedon Aug 14, 2020
Related issue: jestjs/jest#10330
stavalfi commentedon Feb 5, 2021
as a workaround:
until this issue is fixed.
also, https://github.com/evanw/esbuild has impact as well because of this issue. probably https://github.com/swc-project/swc also.
silasdavis commentedon Feb 17, 2021
Are you using
ts-jest? I am seeing this issue when usingts-jestand I have opened a ticket with minimal repro here: kulshekhar/ts-jest#2372