aboutsummaryrefslogtreecommitdiff
path: root/node_modules/babel-plugin-jest-hoist/README.md
blob: 1a90bbe8b165162ed5c3920853724245bd039b1c (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-plugin-jest-hoist

Babel plugin to hoist `jest.disableAutomock`, `jest.enableAutomock`, `jest.unmock`, `jest.mock`, calls above `import` statements. This plugin is automatically included when using [babel-jest](https://github.com/facebook/jest/tree/main/packages/babel-jest).

## Installation

```sh
$ yarn add --dev babel-plugin-jest-hoist
```

## Usage

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

```js
module.exports = {
  plugins: ['jest-hoist'],
};
```

### Via CLI

```sh
$ babel --plugins jest-hoist script.js
```

### Via Node API

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