const path = require('path');
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'jest-environment-jsdom',
  moduleNameMapper: {
    '^lodash-es$': 'lodash',
    '^lodash-es/(.*)$': 'lodash/$1',
    '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
    '^mobx$': path.resolve(__dirname, './node_modules/mobx'),
  },
  transform: {
    'node_modules/@tcwd/weapps-sdk/.+\\.(j|t)sx?$': 'ts-jest',
    'src/.+.js': 'ts-jest',
  },
  transformIgnorePatterns: ['node_modules/(?!@tcwd/weapps-sdk)/', 'src/tests/mocks/.+.js'],
  testPathIgnorePatterns: ['webpack/*'],
  coveragePathIgnorePatterns: ['src/tests'],
};
