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