diff --git a/docs/UpgradingToJest28.md b/docs/UpgradingToJest28.md index fc1a91f2a666..cc18c683b547 100644 --- a/docs/UpgradingToJest28.md +++ b/docs/UpgradingToJest28.md @@ -157,6 +157,10 @@ npm install --save-dev jest-jasmine2 } ``` +## `package.json` `exports` + +Jest now includes full support for [package `exports`](https://nodejs.org/api/packages.html#exports), which might mean that files you import are not resolved correctly. Additionally, Jest now supplies more conditions. `jest-environment-node` has `node` and `node-addons`, while `jest-environment-jsdom` has `browser`. As a result, you might e.g. get browser code which assumes ESM, when Jest provides `['require', 'browser']`. You can either report a bug to the library (or Jest, the implementation is new and might have bugs!) or override the conditions Jest passes. + ## TypeScript :::info diff --git a/website/versioned_docs/version-28.0/UpgradingToJest28.md b/website/versioned_docs/version-28.0/UpgradingToJest28.md index fc1a91f2a666..cc18c683b547 100644 --- a/website/versioned_docs/version-28.0/UpgradingToJest28.md +++ b/website/versioned_docs/version-28.0/UpgradingToJest28.md @@ -157,6 +157,10 @@ npm install --save-dev jest-jasmine2 } ``` +## `package.json` `exports` + +Jest now includes full support for [package `exports`](https://nodejs.org/api/packages.html#exports), which might mean that files you import are not resolved correctly. Additionally, Jest now supplies more conditions. `jest-environment-node` has `node` and `node-addons`, while `jest-environment-jsdom` has `browser`. As a result, you might e.g. get browser code which assumes ESM, when Jest provides `['require', 'browser']`. You can either report a bug to the library (or Jest, the implementation is new and might have bugs!) or override the conditions Jest passes. + ## TypeScript :::info