Jest tests display wrong line numbers when pem library (version 1.14.7 or 1.14.8) is added to project
- Dominant language
- JavaScript
- Stars
- 573
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
It looks like the pem library is causing Jest tests to report the wrong line numbers for failed tests.
Initially, Jest displays the correct line that causes test to fail for a simple test.

When pem is added to the project (uncomment out the first line on testedComponent.js), jest now reports the same failed test on the wrong line number.

This issue seems to have been present in the project since version 1.14.7
It doesn't reproduce for version 1.14.6 and below.
I've created a simple repository that reproduces this issue: https://github.com/josephmfaulkner/reproduce-jest-line-num-issue-when-using-pem
Contributor guide
Research direction
Start with the linked reproduce-jest-line-num-issue-when-using-pem repository and compare the Jest output with pem 1.14.6 versus 1.14.7 or 1.14.8. Use testedComponent.js and the failing test to isolate the version change; done means Jest reports the actual failing line when pem is included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100