/
jest.config.js
34 lines (33 loc) · 1.15 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const paths = require('./config/paths');
module.exports = {
verbose: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx,mjs}'],
setupFiles: [
'<rootDir>/node_modules/regenerator-runtime/runtime',
'<rootDir>/config/polyfills.js',
],
setupFilesAfterEnv: [
'<rootDir>config/jest/setup.js',
'@testing-library/react/cleanup-after-each',
],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs,ts,tsx}',
'<rootDir>/src/**/*.(spec|test).{js,jsx,mjs,ts,tsx}',
],
testEnvironment: 'node',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|mjs|css|json)$)':
'<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx|mjs)$',
],
moduleNameMapper: {
'^.+\\.css$': 'identity-obj-proxy',
},
moduleDirectories: paths.resolveModules,
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node', 'mjs'],
};