Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update babel-jest example #2540

Merged
merged 3 commits into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ The main part is creating a custom jest transformer file that wraps `babel-jest`
behavior in order to set the option, e.g.

```js
module.exports = require("babel-jest").createTransformer({
module.exports = require("babel-jest").default.createTransformer({
rootMode: "upward",
});
```
Expand All @@ -249,6 +249,8 @@ your Jest options via the [transform option](https://jestjs.io/docs/en/configura

so all JS files will be processed with your version of `babel-jest` with the option enabled.

> NOTE: When using `babel-jest` < 27, you must omit the `.default` part: `require("babel-jest").createTransformer({ ...`.
#### Others

There are tons of tools, but at the core of it is that they need the `rootMode` option enabled
Expand Down