$ cnpm install esbuild-jest
With this transformer you can use and transform (ts, js, tsx and jsx) files
npm install --save-dev esbuild-jest esbuild
esbuild-jest transformer should be used in your Jest config file like this:
{
"transform": {
"^.+\\.tsx?$": "esbuild-jest"
}
}
export interface Options {
jsxFactory?: string
jsxFragment?: string
sourcemap?: boolean | 'inline' | 'external'
loaders?: {
[ext: string]: Loader
},
target?: string
format?: string
}
{
"transform": {
"^.+\\.tsx?$": [
"esbuild-jest",
{
sourcemap: true,
loaders: {
'.spec.ts': 'tsx'
}
}
]
}
}
Copyright 2013 - present © cnpmjs.org | Home |