-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.ts
49 lines (42 loc) · 1.17 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
39
40
41
42
43
44
45
46
47
48
49
import baseSWCConfig from './.swcrc.json';
const swcConfig = {
...baseSWCConfig,
jsc: {
...baseSWCConfig.jsc,
paths: {
...baseSWCConfig.jsc.paths,
'@/*': ['src/*'],
},
},
};
export default {
roots: ['<rootDir>'],
setupFilesAfterEnv: ['<rootDir>/tests/test-setup.ts'],
clearMocks: true,
testTimeout: 20000,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
coverageReporters: ['json', 'lcov'],
collectCoverageFrom: [
'<rootDir>/{src,test}/**/*.{js,jsx,ts,tsx}',
'!<rootDir>/node_modules',
'!*.{js,ts,json}',
'!**/types/**/*.ts',
'!**/types.ts',
'!**/*.d.ts',
],
testEnvironment: 'node',
testRegex: '.*\\.test\\.ts$',
testPathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/build'],
transformIgnorePatterns: ['node_modules/.+\\.(ts|tsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
'^@@/(.*)$': '<rootDir>/$1',
'^@/([^\\.]*)$': '<rootDir>/src/$1',
'^@tests/([^\\.]*)$': '<rootDir>/tests/$1',
},
transform: {
'.*\\.(j|t)s$': ['@swc/jest', swcConfig],
},
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};