Registry / testing / esbuild-jest

esbuild-jest

JSON →
library0.5.0jsnpmunverified

Jest transformer that uses esbuild for fast compilation of TypeScript, JavaScript, TSX, and JSX files. Current stable version is 0.5.0. Released as needed, with esbuild >=0.8.50 as peer dependency. Differentiators: significantly faster than ts-jest by leveraging esbuild's speed, but lacks type checking and some advanced TypeScript features. Ships TypeScript types.

npm install esbuild-jest
INSTALL
IMPORT
SIG · ESBUILD-JEST
E
esbuild-jest
testingjavascriptv0.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (transformer)
import esbuildJest from 'esbuild-jest'
Default export is the transformer function. Only named exports are Options types.
Options interface
import type { Options } from 'esbuild-jest'
import { Options } from 'esbuild-jest' (runtime error, type-only)
Options is a TypeScript type, not a value. Use type import.
require with CreateTransformerOptions?
const transformer = require('esbuild-jest')
const { default } = require('esbuild-jest')
CommonJS require returns the transformer directly, not under default.

Shows minimal Jest config using esbuild-jest transformer with sourcemap option and a basic test.

// jest.config.js module.exports = { transform: { '^.+\\.(t|j)sx?$': ['esbuild-jest', { sourcemap: true }] } }; // your.test.ts import { sum } from './sum'; test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); });
Debug
Known issues
gotchaesbuild-jest does not perform type checking, only transpilation.
fix
Run tsc --noEmit separately or use a type-checked alternative like ts-jest.
affects: >=0.0.0
gotchaesbuild-jest is not maintained as actively as alternatives; consider @swc/jest or ts-jest for production.
fix
Switch to @swc/jest or ts-jest.
affects: >=0.0.0
deprecatedThe package is no longer actively maintained.
fix
Migrate to @swc/jest or ts-jest.
affects: >=0.5.0
Errors
Common errors & fixes
Cannot find module 'esbuild-jest' from 'jest.config.js'
esbuild-jest not installed or esbuild peer dependency missing.
fix
npm install --save-dev esbuild-jest esbuild
TypeError: esbuildJest is not a function
Using named import Options as a function.
fix
Use default import for transformer: import esbuildJest from 'esbuild-jest'
Jest encountered an unexpected token (tsx file)
Transform regex does not match .tsx files.
fix
Update regex to '^.+\\.(t|j)sx?$' in jest config
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
esbuildrequiredRequired peer dependency for transformation
Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-jest — npm install esbuild-jest · libregistry