Skip to content

Commit 6e9429a

Browse files
committed
Add babel config file snippet
1 parent db4ab8b commit 6e9429a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: docs/installation/using-with-jest.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ Then, you need to tell Jest to transform `.js` files using `babel-jest`. You can
5252
}
5353
```
5454

55-
Then you need to create babel config using [babel.config.json](https://babeljs.io/docs/en/configuration#babelconfigjson), [.babelrc.json](https://babeljs.io/docs/en/configuration#babelrcjson) or `package.json`:
55+
Then you need to create babel config using [babel.config.json](https://babeljs.io/docs/en/configuration#babelconfigjson) or [.babelrc.json](https://babeljs.io/docs/en/configuration#babelrcjson) config files:
56+
57+
```json
58+
{
59+
"presets": ["@babel/preset-env"]
60+
}
61+
```
62+
63+
You can also add these options to `package.json`:
5664

5765
```json
5866
{
@@ -62,7 +70,7 @@ Then you need to create babel config using [babel.config.json](https://babeljs.i
6270
}
6371
```
6472

65-
### Handling webpack Aliases
73+
### Handling webpack aliases
6674

6775
If you use a resolve alias in the webpack config, e.g. aliasing `@` to `/src`, you need to add a matching config for Jest as well, using the `moduleNameMapper` option:
6876

0 commit comments

Comments
 (0)