module.exports = { preset: 'ts-jest', testEnvironment: 'jsdom', setupFilesAfterEnv: ['/setup.ts'], moduleNameMapper: { '^@/(.*)$': '/src/$1', '^~/(.*)$': '/tests/$1', '^@tarojs/taro$': '/testing/taro-api-mock.ts', '\\.(css|less|scss|sass)$': '/testing/style-mock.js', '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/testing/file-mock.js' }, testMatch: [ '/tests/**/*.spec.{ts,tsx}', '/tests/**/*.test.{ts,tsx}' ], collectCoverageFrom: [ 'src/**/*.{ts,tsx}', '!src/**/*.d.ts', '!src/**/index.{ts,tsx}' ], coverageDirectory: 'coverage', coverageReporters: ['text', 'lcov', 'html'], testPathIgnorePatterns: [ '/node_modules/', '/dist/', '/coverage/' ], transform: { '^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }], '^.+\\.(js|jsx)$': 'babel-jest' }, transformIgnorePatterns: [ '/node_modules/(?!(swiper|@tarojs)/)' ], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'] }