1.0.9 • Published 9 months ago
@jgoz/jest-esbuild v1.0.9
@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-esbuildUsage
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. |