Dexus / Dexus/pem

Jest tests display wrong line numbers when pem library (version 1.14.7 or 1.14.8) is added to project

Open
#389 5 comments 0 reactions 0 assignees View on GitHub
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.
![SCREENSHOT-correct-line-reported](https://github.com/Dexus/pem/assets/13591699/c4f453a7-5768-4679-b025-bc32e5034a3f)

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.
![SCREENSHOT-wrong-line-reported](https://github.com/Dexus/pem/assets/13591699/9ce0ff6c-5afc-479a-817b-3326a2dc132b)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.