@alloc/esbuild-jest
TypeScript icon, indicating that this package has built-in type declarations

0.3.6 • Public • Published

esbuild-jest

npm Code style: Prettier Donate

Jest transformer with esbuild speed

This is a fork of esbuild-jest with the following added features:

  • Sourcemaps enabled by default
  • Strict mode enabled for modules
  • Hoisted jest.mock calls with nebu

Install

yarn add esbuild-jest@npm:@alloc/esbuild-jest esbuild -D

Setting up Jest config file

esbuild-jest transformer should be used in your Jest config file like this:

{
  "transform": {
    "^.+\\.tsx?$": "esbuild-jest"
  }
}

Setting up Jest config file with transformOptions

export interface Options {
  jsxFactory?: string
  jsxFragment?: string
  loaders?: {
    [ext: string]: Loader
  }
  target?: string
}
{
  "transform": {
    "^.+\\.tsx?$": [
      "esbuild-jest",
      {
        loaders: {
          '.spec.ts': 'tsx'
        }
      }
    ]
  }
}

Dependencies (1)

Dev Dependencies (9)

Package Sidebar

Install

npm i @alloc/esbuild-jest

Weekly Downloads

28

Version

0.3.6

License

MIT

Unpacked Size

11.6 kB

Total Files

6

Last publish

Collaborators

  • aleclarson