-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
38 lines (38 loc) · 1.27 KB
/
jest.config.js
File metadata and controls
38 lines (38 loc) · 1.27 KB
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
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
rootDir: 'src',
testMatch: [
'<rootDir>/__tests__/**/*.{test,spec}.(ts|tsx|js|jsx)',
'<rootDir>/**/*.{test,spec}.(ts|tsx|js|jsx)',
'<rootDir>/**/**/*.{test,spec}.(ts|tsx|js|jsx)'
],
coverageDirectory: '../coverage/',
moduleDirectories: ['node_modules', 'src'],
collectCoverageFrom: [
'<rootDir>/**/*.tsx',
'<rootDir>/**/**/*.tsx',
'!<rootDir>/index.tsx',
'!<rootDir>/**/*.d.ts',
'!<rootDir>/test/mock/*.(ts|tsx)'
],
roots: ['<rootDir>'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'node_modules/react-github-btn/.+\\.(j|t)sx?$': 'ts-jest'
},
transformIgnorePatterns: ['node_modules/(?!react-github-btn/.*)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: [
'<rootDir>/__tests__/config/importJestDOM.ts',
'<rootDir>/__tests__/config/setupTest.ts',
'<rootDir>/mock/setupServer.ts'
],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__tests__/__mock__/fileMock.ts',
'\\.(css|scss)$': '<rootDir>/__tests__/__mock__/styleMock.ts',
'^@components(.*)$': '<rootDir>/components$1',
'^@containers(.*)$': '<rootDir>/containers$1',
}
}