Open luxaritas opened 2 years ago
Related: #11453
PR welcome! Logic for config file resolution and reading is in https://github.com/facebook/jest/blob/1919ef13df544a968bd2d32e5d7b8a2a1c4b35d1/packages/jest-config/src/readConfigFileAndSetRootDir.ts
That said, I don't think anything has changed since https://github.com/facebook/jest/issues/11453#issuecomment-1040424443 (i.e. you need a loader). But we should at least find cts
as that is supposed to be converted to cjs
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.
@SimenB as a first step, maybe let's get support for jest.config.cts
, to avoid the extra ts-node.moduleTypes
config for ts-node
Took a quick shot at a PR - does it need anything else? (other than fixing the tests)
Edit: @DerTimonius opened a new PR based on mine, which also fixes the tests:
https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.3 for .cts
support
🚀 Feature Proposal
"type": "module"
is set in the package.json,jest.config.ts
should be treated as ESM, not CJSjest.config.mts
andjest.config.cts
should be looked for and loaded as ESM and CJS, respectivelyMotivation
jest.config.js
, and so ESM vs CJS handling differs between JS and TS configsExample
No response
Pitch