-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjest.config.ts
38 lines (31 loc) · 1.11 KB
/
jest.config.ts
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
35
36
37
38
import nextJest from 'next/jest';
const createJestConfig = nextJest({ dir: '.' });
const customJestConfig = {
roots: ['<rootDir>'],
setupFilesAfterEnv: ['<rootDir>/tests/test-setup.ts'],
clearMocks: true,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
coverageReporters: ['json', 'lcov'],
collectCoverageFrom: [
'<rootDir>/{src,tests}/**/*.{ts,tsx}',
'!<rootDir>/**/*.test.{ts,tsx}',
'!<rootDir>/node_modules',
'!*.{js,ts,json}',
'!**/types/**/*.ts',
'!**/types.ts',
'!**/*.d.ts',
],
testEnvironment: '<rootDir>/tests/test-environment.ts',
testRegex: '^.+\\.test\\.tsx?$',
testPathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/public', '<rootDir>/\\.next'],
transformIgnorePatterns: ['node_modules/.+\\.(ts|tsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
'^@@/(.*)$': '<rootDir>/$1',
'^@/([^\\.]*)$': '<rootDir>/src/$1',
'^@tests/([^\\.]*)$': '<rootDir>/tests/$1',
},
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};
export default createJestConfig(customJestConfig);