aboutsummaryrefslogtreecommitdiff
path: root/node_modules/babel-preset-jest/README.md
blob: 4457c086cece6a5f9884fc4ddbefba822e6feceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# babel-preset-jest

> Babel preset for all Jest plugins. This preset is automatically included when using [babel-jest](https://github.com/facebook/jest/tree/main/packages/babel-jest).

## Install

```sh
$ npm install --save-dev babel-preset-jest
```

## Usage

### Via `babel.config.js` (Recommended)

```js
module.exports = {
  presets: ['jest'],
};
```

### Via CLI

```sh
$ babel script.js --presets jest
```

### Via Node API

```javascript
require('@babel/core').transform('code', {
  presets: ['jest'],
});
```