jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: transform esm module in jest-runtime

Open Howl-Kim opened this issue 1 year ago • 3 comments

Version

29.7.0

Steps to reproduce

  1. clone https://github.com/kim-jaedeok/jest-runtime-report
  2. run the test according to the readme.

Expected behavior

auto-bind is transpiled as a cjs module.

Actual behavior

I know that jest does not support esm module, so if i use esm module, i need to transpile esm module to cjs module via transform. but i have two problems.

  1. if type:"module" is declared in the package.json of an npm package imported from node_modules, an esm module import error occurs before the transform runs.
  2. esmodule is not converted to cjs module after transform is executed, even if type:"module" is not declared.

Additional context

No response

Environment

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M2
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.1.1 - ~/.nvm/versions/node/v20.9.0/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0

Howl-Kim avatar Jun 16 '24 08:06 Howl-Kim

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[bot] avatar Jul 16 '24 09:07 github-actions[bot]

Can you set up a reproduction without ts-jest? That's not maintained in this repo

SimenB avatar Jul 16 '24 09:07 SimenB

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[bot] avatar Aug 15 '24 10:08 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Sep 14 '24 11:09 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Sep 14 '24 11:09 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Oct 15 '24 00:10 github-actions[bot]