Skip to content

Commit

Permalink
Update babel-jest example (#2540)
Browse files Browse the repository at this point in the history
* Update `babel-jest` example

* Update docs/config-files.md

Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>

* Update docs/config-files.md

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
  • Loading branch information
3 people authored Jul 30, 2021
1 parent 4c1471e commit 7124917
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` &lt; 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

0 comments on commit 7124917

Please sign in to comment.