Skip to content

Latest commit

 

History

History
58 lines (50 loc) · 869 Bytes

File metadata and controls

58 lines (50 loc) · 869 Bytes
title
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

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
  // [...]
  transform: {
    '<regex_match_files>': [
      'ts-jest',
      {
        useESM: true,
      },
    ],
  },
}
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
  // [...]
  transform: {
    '<regex_match_files>': [
      'ts-jest',
      {
        useESM: true,
      },
    ],
  },
}

export default jestConfig
{
  // [...]
  "jest": {
    "transform": {
      "<regex_match_files>": [
        "ts-jest",
        {
          "useESM": true
        }
      ]
    }
  }
}