2022-02-19 02:14:23 -05:00
|
|
|
import type { Config } from '@jest/types';
|
|
|
|
|
|
|
|
const config: Config.InitialOptions = {
|
|
|
|
preset: 'ts-jest',
|
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
transform: {
|
|
|
|
// Enable JS/JSX transformation
|
|
|
|
'\\.(ts|js)x?$': 'ts-jest',
|
2022-03-15 04:31:13 -05:00
|
|
|
'\\.(svg)$': 'jest-transform-stub',
|
2022-02-19 02:14:23 -05:00
|
|
|
},
|
|
|
|
transformIgnorePatterns: [
|
|
|
|
'[/\\\\]node_modules[/\\\\]((?!ky[/\\\\]).)+\\.(js|jsx|mjs|cjs|ts|tsx)$',
|
|
|
|
],
|
|
|
|
moduleNameMapper: {
|
|
|
|
// Map path alias in `tsconfig.json`
|
|
|
|
'@/(.*)': '<rootDir>/src/$1',
|
|
|
|
// Mock CSS Modules
|
|
|
|
'\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
|
|
|
|
},
|
|
|
|
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
|
2022-04-08 04:47:09 -05:00
|
|
|
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/src/__mocks__/'],
|
2022-02-19 02:14:23 -05:00
|
|
|
coverageReporters: ['text-summary', 'lcov'],
|
|
|
|
globals: {
|
|
|
|
'ts-jest': {
|
|
|
|
tsconfig: './tsconfig.test.json',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|