forked from abraham-musa/developer-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit.jest.config.js
68 lines (68 loc) · 1.8 KB
/
unit.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
module.exports = {
name: 'unit',
automock: false,
displayName: 'Unit Tests',
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.{d,e2e,test}.{ts,tsx}',
'!src/base.accessibility.ts',
'!src/e2eHelpers.ts',
'!src/index.tsx',
'!src/registerServiceWorker.ts',
'!src/visualRegressionTest.ts',
'!src/containers/consumerOnboarding/validationSchema.ts',
],
coverageThreshold: {
global: {
branches: 65,
functions: 75,
lines: 85,
statements: 85
}
},
setupFiles: [
'<rootDir>/config/polyfills.js',
'<rootDir>/config/jest/testEnv.js', // only necessary when running Jest directly
],
setupFilesAfterEnv: ['<rootDir>/config/jest/setupJestPostEnv.js'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.(j|t)s?(x)',
'<rootDir>/src/**/?(*.)(spec|test).(j|t)s?(x)',
],
testPathIgnorePatterns: [],
testEnvironment: 'jsdom',
testURL: process.env.TEST_HOST || 'http://localhost:4444',
transform: {
'^.+\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^.+\\.ya?ml$': '<rootDir>/config/jest/yamlTransform.js',
'^(?!.*\\.(js|jsx|mjs|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$'],
moduleNameMapper: {
'^react-native$': 'react-native-web',
'content/news.yml': '<rootDir>/src/__mocks__/news.test.yml',
'\\.(svg|png)': '<rootDir>/src/__mocks__/fakeImage.ts',
},
moduleFileExtensions: [
'web.ts',
'ts',
'web.tsx',
'tsx',
'web.js',
'js',
'yml',
'yaml',
'web.jsx',
'jsx',
'json',
'node',
'mjs',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
},
};