# babel-jest

> Jest plugin to use babel for transformation.

Latest version **30.5.1** (published 2026-09-01) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2026-09-01 |
| First published | 2015-02-15 |
| 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 | 7 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45457 |
| Maintainers | aaronabramov, simenb, rickhanlonii, openjs-operations, cpojer |

## Links

- npm: https://www.npmjs.com/package/babel-jest
- 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-jest

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [slash](https://npm.io/package/slash.md) ^3.0.0
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.2.11
- [@jest/transform](https://npm.io/package/@jest/transform.md) 30.5.1
- [babel-preset-jest](https://npm.io/package/babel-preset-jest.md) 30.5.0
- [@types/babel__core](https://npm.io/package/@types/babel__core.md) ^7.20.5
- [babel-plugin-istanbul](https://npm.io/package/babel-plugin-istanbul.md) ^8.0.0

## Recent versions

- 30.5.1 (latest) — 2026-09-01
- 30.0.0-rc.1 (next) — 2025-06-09
- 30.5.0 — 2026-08-28
- 30.4.1 — 2026-05-08
- 30.4.0 — 2026-05-07
- 30.3.0 — 2026-03-10
- 30.2.0 — 2025-09-28
- 30.1.2 — 2025-09-01
- 30.1.1 — 2025-08-27
- 30.1.0 — 2025-08-27
- 30.0.5 — 2025-07-22
- 30.0.4 — 2025-07-02
- 30.0.2 — 2025-06-19
- 30.0.1 — 2025-06-18
- 30.0.0 — 2025-06-10
- … 288 more at https://npm.io/package/babel-jest/versions

## README

# babel-jest

[Babel](https://github.com/babel/babel) [jest](https://github.com/jestjs/jest) plugin

## Usage

If you are already using `jest-cli`, add `babel-jest` and it will automatically compile JavaScript code using Babel.

```bash
yarn add --dev babel-jest @babel/core
```

If you would like to write your own preprocessor, uninstall and delete babel-jest and set the [config.transform](https://jestjs.io/docs/configuration#transform-object-string-string) option to your preprocessor.

## Setup

_Note: this step is only required if you are using `babel-jest` with additional code preprocessors._

To explicitly define `babel-jest` as a transformer for your JavaScript code, map _.js_ files to the `babel-jest` module. Typescript files are also supported.

By default, it loads your existing Babel configuration (if any)

```json
"transform": {
  "\\.[jt]sx?$": "babel-jest"
},
```

You can also pass further [babel options](https://babeljs.io/docs/options)

```json
"transform": {
  "\\.[jt]sx?$": ["babel-jest", { "extends": "./babel.config.js", "plugins": ["babel-plugin-transform-import-meta"] }]
},
```

By default, `babel-jest` includes `babel-preset-jest`. In addition to the babel options, we introduce a new option, `excludeJestPreset`, which allows you to disable this behavior. Note that this will break `jest.mock` hoisting.

```json
"transform": {
  "\\.[jt]sx?$": ["babel-jest", { "excludeJestPreset": true }],
}
```

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