const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig')

module.exports = {
  testEnvironment: "jsdom",
  roots: [
    "<rootDir>"
  ],
  modulePaths: [
    compilerOptions.baseUrl
  ],
  moduleDirectories: [
    ".",
    "src",
    "node_modules",
    "src/react/components"
  ],
  transform: {
    "\\.js$": "babel-jest",
    "^.+\\.(tsx|ts)$": "ts-jest",
    "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/transformers.js",
  },
  moduleFileExtensions: [
    "ts",
    "tsx",
    "js",
    "jsx"
  ],
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths)
};