Skip to content

Conversation

@hainenber
Copy link
Contributor

Summary

Fixes #15876

For pnpm projects, it's better to use native JS runtime (bun, node or deno) to perform module resolution for default Jest test deps like @jest/test-sequencer and jest-environment-node. We should rely on third-party mechanisms like Rust-based resolvers when it comes to custom test deps.

IMO, this should be enabled for all package managers, not just pnpm but to prevent potential incidents, let's limit the blast radius to one packman only.

Test plan

  • Test added.
  • Confirmation from affected user.

…use `pnpm`

Signed-off-by: hainenber <dotronghai96@gmail.com>
@netlify
Copy link

netlify bot commented Oct 26, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8320a7f
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/68ff8ad2a2c54d00085e6eca
😎 Deploy Preview https://deploy-preview-15877--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: hainenber <dotronghai96@gmail.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 26, 2025

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15877

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15877

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15877

create-jest

npm i https://pkg.pr.new/create-jest@15877

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15877

expect

npm i https://pkg.pr.new/expect@15877

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15877

jest

npm i https://pkg.pr.new/jest@15877

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15877

jest-circus

npm i https://pkg.pr.new/jest-circus@15877

jest-cli

npm i https://pkg.pr.new/jest-cli@15877

jest-config

npm i https://pkg.pr.new/jest-config@15877

@jest/console

npm i https://pkg.pr.new/@jest/console@15877

@jest/core

npm i https://pkg.pr.new/@jest/core@15877

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15877

jest-diff

npm i https://pkg.pr.new/jest-diff@15877

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15877

jest-each

npm i https://pkg.pr.new/jest-each@15877

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15877

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15877

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15877

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15877

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15877

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15877

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15877

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15877

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15877

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15877

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15877

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15877

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15877

jest-mock

npm i https://pkg.pr.new/jest-mock@15877

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15877

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15877

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15877

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15877

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15877

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15877

jest-runner

npm i https://pkg.pr.new/jest-runner@15877

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15877

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15877

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15877

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15877

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15877

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15877

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15877

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15877

@jest/types

npm i https://pkg.pr.new/@jest/types@15877

jest-util

npm i https://pkg.pr.new/jest-util@15877

jest-validate

npm i https://pkg.pr.new/jest-validate@15877

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15877

jest-worker

npm i https://pkg.pr.new/jest-worker@15877

pretty-format

npm i https://pkg.pr.new/pretty-format@15877

commit: 8320a7f

@SimenB
Copy link
Member

SimenB commented Oct 27, 2025

We should rely on third-party mechanisms like Rust-based resolvers when it comes to custom test deps.

I don't agree with this as any difference in resolution is a bug. If a dep is not resolved correctly in the config, there might be other discrepancies when running tests as well. So I'd rather fix the resolution bug within Jest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Test environment resolves to wrong version when using pnpm

2 participants