Skip to content

Commit

Permalink
chore: mention exports being breaking in upgrade guide (#12739)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Apr 25, 2022
1 parent b36dbf4 commit b30f908
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/UpgradingToJest28.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-28.0/UpgradingToJest28.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b30f908

Please sign in to comment.