@jgoz/jest-esbuild
v1.0.8
Published
Esbuild transformer for Jest
Downloads
326
Readme
@jgoz/jest-esbuild
An esbuild transform for Jest that supports mock hoisting.
Features
- Supports mock hoisting via babel-plugin-jest-hoist
- Accepts esbuild transform options
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. |