-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
76 lines (76 loc) · 2.57 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
module.exports = {
testEnvironment: 'jest-environment-jsdom-fourteen',
displayName: {
name: 'SpaceXplorerClient',
color: 'yellow',
},
roots: ['<rootDir>/src'],
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
testMatch: [
'<rootDir>/__tests__/**/*.{js,ts,tsx,jsx,mjs}',
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/src/**/__tests__/**/*.{js,ts,tsx,jsx,mjs}',
'<rootDir>/src/**/?(*.)(spec|test).{js,ts,tsx,jsx,mjs}',
],
setupFiles: ['react-app-polyfill/jsdom'],
setupFilesAfterEnv: ['<rootDir>/scripts/setupTests.ts'],
collectCoverageFrom: ['<rootDir>/src/**/*.ts', '!**/node_modules/**'],
coveragePathIgnorePatterns: [
'/node_modules/',
'<rootDir>/src/api/gql/GqlClient.ts',
'<rootDir>/src/api/gql/schemas.ts',
'<rootDir>/src/serviceWorker.ts',
'<rootDir>/src/react-app-env.d.ts',
'<rootDir>/src/window.d.ts',
'<rootDir>/src/storage/cache/cache.ts',
'<rootDir>/src/logger/index.ts',
'<rootDir>/src/test-utils.tsx',
],
coverageThreshold: {
global: {
lines: 85,
statements: 85,
},
},
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
moduleNameMapper: {
'^react-native$': 'react-native-web',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'^@storage/(.*)$': '<rootDir>/src/storage/$1',
'^@cache': '<rootDir>/src/storage/cache/cache.ts',
'^@localStorage': '<rootDir>/src/storage/local/local.ts',
'^@gqlClient': '<rootDir>/src/api/gql/GqlClient.ts',
'^@gqlOps/(.*)$': '<rootDir>/src/api/gql/__generated__/$1',
'^@restClient': '<rootDir>/src//api/rest/RestClient.ts',
'^@schemas': '<rootDir>/src/api/gql/schemas.ts',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@containers/(.*)$': '<rootDir>/src/containers/$1',
'^@assets/(.*)$': '<rootDir>/src/assets/$1',
'^@styles': '<rootDir>/src/styles.ts',
'^@logger': '<rootDir>/src/logger/index.ts',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
},
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};