{"id":25293,"library":"esbuild-jest-fixed","title":"esbuild-jest-fixed","description":"A Jest transformer leveraging esbuild for fast TypeScript, JavaScript, TSX, and JSX compilation. Version 0.5.2 is the latest stable release; the project is a fork of esbuild-jest that resolves a critical bug where source code containing the substring \"ock(\" (e.g., \"mock(\") would cause compilation failures. It supports configurable jsxFactory, jsxFragment, sourcemap, loaders, target, and format options, and is designed as a drop-in replacement for ts-jest with significantly faster transpilation. Requires esbuild >=0.9.3 as a peer dependency. The package ships TypeScript type definitions.","status":"active","version":"0.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/yuliswe/esbuild-jest-fixed","tags":["javascript","esbuild","jest","test","typescript"],"install":[{"cmd":"npm install esbuild-jest-fixed","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-jest-fixed","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-jest-fixed","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime peer dependency: provides the core bundler/transpiler used by the transformer","package":"esbuild","optional":false}],"imports":[{"note":"Package exports a default transformer factory; named export does not exist in v0.5.2","wrong":"import { createTransformer } from 'esbuild-jest-fixed'","symbol":"esbuild-jest-fixed","correct":"import createTransformer from 'esbuild-jest-fixed'"},{"note":"TypeScript type import only; using value import will fail at runtime","wrong":"import { Options } from 'esbuild-jest-fixed'  // Options is a type, not a runtime value","symbol":"Options (type)","correct":"import type { Options } from 'esbuild-jest-fixed'"},{"note":"Package name in Jest config must exactly match 'esbuild-jest-fixed' to find the correct module","wrong":"\"esbuild-jest\" in config when using the fork","symbol":"Jest config string reference","correct":"\"esbuild-jest-fixed\" in Jest transform config"}],"quickstart":{"code":"// jest.config.js\nmodule.exports = {\n  transform: {\n    '^.+\\\\.tsx?$': [\n      'esbuild-jest-fixed',\n      {\n        sourcemap: true,\n        target: 'es2020'\n      }\n    ]\n  }\n};\n\n// example.test.ts\nimport { sum } from './sum';\n\ntest('sum adds numbers', () => {\n  expect(sum(1, 2)).toBe(3);\n});\n\n// sum.ts\nexport function sum(a: number, b: number): number {\n  return a + b;\n}\n\n// Run: npx jest","lang":"typescript","description":"Configures Jest with esbuild-jest-fixed transformer to compile TypeScript files, demonstrates a basic test and implementation."},"warnings":[{"fix":"Replace 'esbuild-jest' with 'esbuild-jest-fixed' in Jest configuration transform patterns","message":"Jest transform keys using 'esbuild-jest' will not work with the fixed fork; must use 'esbuild-jest-fixed'","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use esbuild-jest-fixed v0.5.2+ which patches the 'ock(' issue","message":"Source code containing substring 'ock(' (e.g., 'mock(' or 'block(') could cause compilation errors in original esbuild-jest <0.2.0; fixed fork resolves this","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to esbuild-jest-fixed for continued support and bug fixes","message":"The original esbuild-jest package is no longer maintained; this fork is the active alternative","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install esbuild-jest-fixed and use 'esbuild-jest-fixed' in config","cause":"Using 'esbuild-jest' in Jest config but package not installed or intended to use fork","error":"Cannot find module 'esbuild-jest' from 'jest.config.js'"},{"fix":"Use `import createTransformer from 'esbuild-jest-fixed'` (no braces)","cause":"Importing named export `createTransformer` instead of default import","error":"TypeError: createTransformer is not a function"},{"fix":"Run `npm install esbuild --save-dev`","cause":"Missing peer dependency esbuild","error":"Module build failed: Error: The package \"esbuild\" is required but not installed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}