26 lines
887 B
TypeScript
26 lines
887 B
TypeScript
/* eslint-disable jest/no-jest-import */
|
|
import { pathsToModuleNameMapper } from 'ts-jest';
|
|
import { compilerOptions } from './tsconfig.json';
|
|
|
|
const config = {
|
|
clearMocks: true,
|
|
testEnvironment: 'jsdom',
|
|
transform: {
|
|
'^.+\\.(ts|tsx)$': 'ts-jest',
|
|
},
|
|
verbose: true,
|
|
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
roots: ['<rootDir>'],
|
|
modulePaths: [compilerOptions.baseUrl],
|
|
moduleNameMapper: {
|
|
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
|
|
'^axios$': 'axios/dist/axios.js',
|
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/src/mocks/fileMock.js',
|
|
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/src/mocks/setupTests.ts'],
|
|
};
|
|
|
|
export default config;
|