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

1.0.5 • Public • Published

@jgoz/jest-esbuild

An esbuild transform for Jest that supports mock hoisting.

Features

Install

$ npm i @jgoz/jest-esbuild

Usage

Add it to your jest config:

{
  "transform": {
    "^.+\\.tsx?$": ["@jgoz/jest-esbuild"]
  }
}

Or with options:

{
  "transform": {
    "^.+\\.tsx?$": [
      "@jgoz/jest-esbuild",
      {
        "esbuild": {
          "jsx": "automatic",
          "target": "es2017"
        }
      }
    ]
  }
}

Options

Name Type Default Description
esbuild TransformOptions - Esbuild transform options.
hoistMatch string[] testMatch Alternate glob patterns for files that should be transformed with Babel for mock hoisting. If specified, only files matching this pattern will be transformed with Babel after being transformed with esbuild.

Readme

Keywords

Package Sidebar

Install

npm i @jgoz/jest-esbuild

Weekly Downloads

30

Version

1.0.5

License

MIT

Unpacked Size

48.3 kB

Total Files

10

Last publish

Collaborators

  • jgoz