forked from KaiHotz/react-rollup-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
24 lines (24 loc) · 1.05 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
module.exports = {
'roots': ['<rootDir>/src'],
'collectCoverageFrom': ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts', '!src/**/index.js'],
'setupFiles': ['react-app-polyfill/jsdom'],
'setupFilesAfterEnv': ['<rootDir>/jest.setup.js'],
'testMatch': ['<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', '<rootDir>/**/*.{spec,test}.{js,jsx,ts,tsx}'],
'testEnvironment': 'jest-environment-jsdom',
'transform': {
'^.+\\.[t|j]sx?$': 'babel-jest',
'^.+\\.css$': '<rootDir>/config/cssTransform.js',
'\\.(jpg|jpeg|png|gif|webp|svg|woff|woff2)$': '<rootDir>/config/fileTransform.js',
},
resolver: 'jest-pnp-resolver',
'transformIgnorePatterns': ['node_modules'],
'modulePaths': ['<rootDir>/src'],
'moduleDirectories': ['node_modules', 'src'],
'coverageDirectory': '<rootDir>/coverage',
'coverageReporters': ['lcov'],
'moduleNameMapper': {
'^.+\\.(css|scss)$': 'identity-obj-proxy',
},
'moduleFileExtensions': ['js', 'jsx', 'json', 'ts', 'tsx'],
'watchPlugins': ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};