jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.12k stars 6.44k forks source link

[Feature]: Publish real ESM for `expect` (and perhaps other modules) #15272

Open rschristian opened 1 month ago

rschristian commented 1 month ago

🚀 Feature Proposal

Publishing real ESM, rather than ESM that imports from CJS, would be really useful for expect as it allows it to be used in environments outside of Node.

Motivation

As it stands, this faux ESM is just a facade for CJS and doesn't work outside of Node.

Example

No response

Pitch

expect (and potentially other packages), are extracted so that others may use them (at least I think that's the idea). Choosing to ship an ESM facade, however, limits the usefulness quite a bit as users are locked to Node.

I'm hoping that this wouldn't be too big of a lift for Jest, as it seems there is some desire to ship ESM for consumers.

github-actions[bot] commented 1 week ago

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.