{"id":25236,"library":"es-jest","title":"es-jest","description":"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+.","status":"maintenance","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ambar/es-jest","tags":["javascript","jest","esbuild","testing"],"install":[{"cmd":"npm install es-jest","lang":"bash","label":"npm"},{"cmd":"yarn add es-jest","lang":"bash","label":"yarn"},{"cmd":"pnpm add es-jest","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for usage","package":"jest","optional":false},{"reason":"Transpilation engine","package":"esbuild","optional":false}],"imports":[{"note":"This package is CJS only; dynamic import may work but require() is standard. Used as a transform processor, not directly invoked.","wrong":"import esJest from 'es-jest'","symbol":"es-jest","correct":"const esJest = require('es-jest')"},{"note":"Preset is a string in Jest config, not an exported symbol.","wrong":"import { preset } from 'es-jest'","symbol":"preset","correct":"use in jest config: 'preset': 'es-jest'"},{"note":"Transform is a config entry, not an import.","wrong":"import { transform } from 'es-jest'","symbol":"transform","correct":"use in jest config as ['es-jest', options]"}],"quickstart":{"code":"// jest.config.js\nmodule.exports = {\n  preset: 'es-jest',\n  // optional custom esbuild config:\n  // transform: {\n  //   '\\\\.(js|ts|jsx|tsx)$': ['es-jest', { jsx: 'automatic' }]\n  // }\n}\n\n// src/__tests__/example.test.js\nimport { sum } from '../sum';\n\ntest('adds 1 + 2 to equal 3', () => {\n  expect(sum(1, 2)).toBe(3);\n});","lang":"javascript","description":"Demonstrates minimal setup via preset and a simple test using ES modules."},"warnings":[{"fix":"Consider using jest-light-runner or @jest/transform-esbuild for ongoing support.","message":"Package has not been updated since 2021; may be incompatible with newer Jest versions (>27).","severity":"deprecated","affected_versions":">=2.1.0"},{"fix":"Use double backslashes in JSON: '\\\\.(js|ts)x?$'","message":"When using custom transform entry, must escape regex or use string pattern correctly.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use ts-jest or run tsc separately for type safety.","message":"es-jest does not support TypeScript type checking; it only strips types.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure esbuild version meets requirements and pass options correctly.","message":"JSX automatic runtime requires esbuild >=0.14 and config option { jsx: 'automatic' }","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install es-jest --save-dev'.","cause":"es-jest is not installed","error":"Cannot find module 'es-jest' from 'jest.config.js'"},{"fix":"Use module.exports in a .js config file, or ensure preset path is correct.","cause":"Jest cannot find the preset; incorrect config file type (e.g., using ESM for config)","error":"Jest preset \"es-jest\" not found."},{"fix":"Configure transform or preset in jest config. Add 'transform': { '\\\\.js$': 'es-jest' }","cause":"Jest not using es-jest transform; file is not transpiled","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Add appropriate moduleNameMapper or transformIgnorePatterns.","cause":"Missing babel-jest or incorrect transform for non-code files (e.g., CSS, images)","error":"Error: Jest encountered an unexpected token. Jest failed to parse a file."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}