Skip to main content
Version: 27.1

useESM option

The useESM option allows ts-jest to transform codes to ESM syntax if possible.

The default value is false, ts-jest will transform codes to CommonJS syntax.

Examples

// jest.config.js
module.exports = {
// [...]
globals: {
'ts-jest': {
useESM: true,
},
},
}
// OR package.json
{
// [...]
"jest": {
"globals": {
"ts-jest": {
"useESM": true
}
}
}
}