Jest (with ts-jest) displays wrong line number when pem library is added to TypeScript project

24 views Asked by At

I'm having an issue in which Jest (with ts-jest) doesn't display the correct line number that causes a given test to fail. Specifically, this happens when I try to incorporate the pem library into the the project. https://www.npmjs.com/package/pem . If I omit this library (or at least comment out the code that uses it), the line reported by Jest works just fine.

My goal is to have Jest report the correct line that causes a test to fail, even when the pem library is used by the project. One requirement is that I need to use pem version 1.14.8 At the moment, the @types library only goes up to version 1.14.4, which might be what's causing this problem. Not sure if there's a work around.

I've created a repository that reproduces this issue here: https://github.com/josephmfaulkner/reproduce-jest-line-num-issue-when-using-pem

Jest displays the correct line that causes test to fail.

enter image description here

0

There are 0 answers