Errors in jest are not at proper line number
toolness opened this issue · comments
Something is funky with the way Jest is tracing errors back to their source. I think it may be getting the line number at some point in transpilation, rather than at the original source, but I'm not sure:
In the above screenshot, an error with the message LOL
has been thrown at line 13 of a file, but jest seems to think it was thrown at line 10, which is confusing.
Uhh, what's even weirder is that in the above code, the LOL
error wasn't even supposed to be thrown--somehow Jest was using stale code for at least one of my modules. Completely quitting Jest and re-starting it made all my tests run without error.
Might be worth trying out ts-jest