-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest tests display wrong line numbers when pem library (version 1.14.7 or 1.14.8) is added to project #389
Comments
I think you've independently discovered the same issue I spent all afternoon tracking down. Could you try something to see if this is indeed the same issue? In |
It seems like this can be resolved by importing from import * as pem from 'pem/lib/pem'; @Dexus can you confirm if the Can you share more about why the |
@nwalters512 |
Hi! Just came here to note that Beyond that, I don't actually want |
Turns out `pem`'s main export will install its own global `process.emit` source map handler, for who-the-muffin-knows-why. But in any case, (a) it shouldn't, but thankfully (b) it's at least possible to avoid it doing that. So this PR avoids the installation and adds a test to make sure it doesn't start happening again. FWIW I was a bit wary when I started using `pem` in the first place, and this experience makes me reluctant to leave it in, in the long term. See <Dexus/pem#389> and <jestjs/jest#15077> for more details. And thanks very much to @SimenB and @nwalters512 for their assistance.
This PR is a compendium of miscellanea, following up on the last few days' worth of work. Notably, this PR removes our use of the `pem` module from NPM as a dependency, replacing it with `selfsigned`. TBQH the state of `pem` is consistent with being in the early stage of a "supply chain" attack. See <jestjs/jest#15077> and <Dexus/pem#389> for some history / details.
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
The text was updated successfully, but these errors were encountered: