Skip to content

Commit 6f9c45d

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

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/installation/using-with-jest.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ 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+
64+
You can also add these options to `package.json`:
5665

5766
```json
5867
{
@@ -62,7 +71,7 @@ Then you need to create babel config using [babel.config.json](https://babeljs.i
6271
}
6372
```
6473

65-
### Handling webpack Aliases
74+
### Handling webpack aliases
6675

6776
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:
6877

0 commit comments

Comments
 (0)