Registry / testing / es-jest

es-jest

JSON →
library2.1.0jsnpmunverified

es-jest is a preprocessor for Jest that uses esbuild to transform ESM, React JSX, and TypeScript files. Version 2.1.0 (latest, last released in 2021) is stable but in maintenance mode. It offers faster transformation than babel-jest or ts-jest by leveraging esbuild, and supports custom esbuild configurations. It can be used as a Jest preset or via a transform entry. Note that major Jest version updates may break compatibility; v2 requires Jest 26+.

npm install es-jest
INSTALL
IMPORT
SIG · ES-JEST
E
es-jest
testingjavascriptv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

es-jest
const esJest = require('es-jest')
import esJest from 'es-jest'
This package is CJS only; dynamic import may work but require() is standard. Used as a transform processor, not directly invoked.
preset
use in jest config: 'preset': 'es-jest'
import { preset } from 'es-jest'
Preset is a string in Jest config, not an exported symbol.
transform
use in jest config as ['es-jest', options]
import { transform } from 'es-jest'
Transform is a config entry, not an import.

Demonstrates minimal setup via preset and a simple test using ES modules.

// jest.config.js module.exports = { preset: 'es-jest', // optional custom esbuild config: // transform: { // '\\.(js|ts|jsx|tsx)$': ['es-jest', { jsx: 'automatic' }] // } } // src/__tests__/example.test.js import { sum } from '../sum'; test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); });
Debug
Known issues
deprecatedPackage has not been updated since 2021; may be incompatible with newer Jest versions (>27).
fix
Consider using jest-light-runner or @jest/transform-esbuild for ongoing support.
affects: >=2.1.0
gotchaWhen using custom transform entry, must escape regex or use string pattern correctly.
fix
Use double backslashes in JSON: '\\.(js|ts)x?$'
affects: >=2.0.0
gotchaes-jest does not support TypeScript type checking; it only strips types.
fix
Use ts-jest or run tsc separately for type safety.
affects: >=1.0.0
gotchaJSX automatic runtime requires esbuild >=0.14 and config option { jsx: 'automatic' }
fix
Ensure esbuild version meets requirements and pass options correctly.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'es-jest' from 'jest.config.js'
es-jest is not installed
fix
Run 'npm install es-jest --save-dev'.
Jest preset "es-jest" not found.
Jest cannot find the preset; incorrect config file type (e.g., using ESM for config)
fix
Use module.exports in a .js config file, or ensure preset path is correct.
SyntaxError: Unexpected token 'export'
Jest not using es-jest transform; file is not transpiled
fix
Configure transform or preset in jest config. Add 'transform': { '\\.js$': 'es-jest' }
Error: Jest encountered an unexpected token. Jest failed to parse a file.
Missing babel-jest or incorrect transform for non-code files (e.g., CSS, images)
fix
Add appropriate moduleNameMapper or transformIgnorePatterns.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
jestrequiredPeer dependency required for usage
esbuildrequiredTranspilation engine
Agent activity
4 hits · last 30 days
node
4
Resources
es-jest — npm install es-jest · libregistry