Jest typescript tests runs twice, one for ts files, and one for js files

Is this normal in ts-jest or am I missing some extra configuration

You should set roots to /src only. Here is a good config:

module.exports = {
  "roots": [
    "<rootDir>/src"
  ],
  "transform": {
    "^.+\\.tsx?$": "ts-jest"
  },
  "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
  "moduleFileExtensions": [
    "ts",
    "tsx",
    "json"
  ],
}

I also only test .tsx? files (no .jsx?) 😉

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)