# 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/jestjs/jest/tree/main/packages/babel-jest).

Latest version **30.5.0** (published 2026-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-jest-hoist
pnpm add babel-plugin-jest-hoist
yarn add babel-plugin-jest-hoist
bun add babel-plugin-jest-hoist
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 30.5.0 |
| Published | 2026-08-28 |
| First published | 2016-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^18.14.0 \|\| ^20.0.0 \|\| ^22.0.0 \|\| >=24.0.0 |
| Dependencies | 1 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45458 |
| Maintainers | aaronabramov, simenb, rickhanlonii, openjs-operations, cpojer |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-jest-hoist
- Repository: https://github.com/jestjs/jest
- Homepage: https://github.com/jestjs/jest#readme
- Issues: https://github.com/jestjs/jest/issues
- npm.io page: https://npm.io/package/babel-plugin-jest-hoist

## Dependencies (1)

- [@types/babel__core](https://npm.io/package/@types/babel__core.md) ^7.20.5

## Recent versions

- 30.5.0 (latest) — 2026-08-28
- 30.0.0-beta.8 (next) — 2025-06-04
- 30.4.0 — 2026-05-07
- 30.3.0 — 2026-03-10
- 30.2.0 — 2025-09-28
- 30.0.1 — 2025-06-18
- 30.0.0 — 2025-06-10
- 30.0.0-beta.7 — 2025-06-04
- 30.0.0-beta.6 — 2025-06-03
- 30.0.0-beta.4 — 2025-05-27
- 30.0.0-beta.3 — 2025-05-27
- 30.0.0-beta.1 — 2025-05-27
- 30.0.0-alpha.7 — 2025-01-30
- 30.0.0-alpha.6 — 2024-08-08
- 30.0.0-alpha.5 — 2024-05-30
- … 188 more at https://npm.io/package/babel-plugin-jest-hoist/versions

## README

# 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/jestjs/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'],
});
```

---
_Source: https://npm.io/package/babel-plugin-jest-hoist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
