0.3.6 • Published 5 years ago
@alloc/esbuild-jest v0.3.6
esbuild-jest
Jest transformer with
esbuildspeed
This is a fork of esbuild-jest with the following added features:
- Sourcemaps enabled by default
- Strict mode enabled for modules
- Hoisted
jest.mockcalls with nebu
Install
yarn add esbuild-jest@npm:@alloc/esbuild-jest esbuild -DSetting 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'
}
}
]
}
}