Skip to content

Commit

Permalink
Update babel-jest example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo authored May 25, 2021
1 parent 33810c0 commit 5cdcd72
Showing 1 changed file with 3 additions and 1 deletion.
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` ≤ 26, 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

0 comments on commit 5cdcd72

Please sign in to comment.