Skip to content
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

[Bug]: jest does not work correctly with import.meta.resolve in ESM context #15330

Open
KostyaTretyak opened this issue Sep 29, 2024 · 2 comments

Comments

@KostyaTretyak
Copy link

KostyaTretyak commented Sep 29, 2024

Version

29.7.0

Steps to reproduce

Step 1. Clone my repo and install deps:

git clone https://github.com/KostyaTretyak/jest-node-path-bug.git
npm i

Step 2. Run index.mjs with this command:

node --experimental-vm-modules index.mjs

Node.js with this flag works correctly.

Step 3. Run index.spec.mjs with this command:

node --experimental-vm-modules node_modules/jest/bin/jest.js

Throw this error:

TypeError: (intermediate value).resolve is not a function

Expected behavior

jest should not throw errors with native Node.js methods.

Actual behavior

jest throw errors with native Node.js methods.

Additional context

No response

Environment

System:
    OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.17.0/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    bun: 1.1.29 - ~/.bun/bin/bun
  npmPackages:
    jest: ^29.7.0 => 29.7.0
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 30, 2024
@KostyaTretyak
Copy link
Author

This issue is actual.

@github-actions github-actions bot removed the Stale label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant