-
Notifications
You must be signed in to change notification settings - Fork 252
/
jest.config.js
131 lines (128 loc) · 4.16 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
const testsForPackage = (packageName) => `<rootDir>/packages/${packageName}/**/*.test.[jt]s?(x)`
const project = (displayName, packageNames, config = {}) => ({
roots: ['<rootDir>/packages'],
displayName,
testMatch: packageNames.map(testsForPackage),
...config
})
const extensions = 'js,jsx,ts,tsx'
module.exports = {
collectCoverageFrom: [
`**/packages/*/**/*.{${extensions}}`,
`!**/*.test.{${extensions}}`,
`!**/*.test-*.{${extensions}}`,
'!**/*.d.ts',
'!**/dist/**',
'!**/packages/js/**',
'!<rootDir>/packages/plugin-angular/**/*',
'!<rootDir>/packages/react-native/src/test/setup.js',
'!<rootDir>/packages/plugin-node-surrounding-code/test/fixtures/**/*'
],
coverageReporters: [
'json-summary', 'json', 'lcov', 'text', 'clover'
],
projects: [
project('core', ['core']),
project('web workers', ['web-worker']),
project('shared plugins', ['plugin-app-duration', 'plugin-stackframe-path-normaliser']),
project('browser', [
'browser',
'delivery-x-domain-request',
'delivery-xml-http-request',
'delivery-fetch',
'plugin-react',
'plugin-vue',
'plugin-browser-context',
'plugin-browser-device',
'plugin-browser-request',
'plugin-client-ip',
'plugin-navigation-breadcrumbs',
'plugin-network-breadcrumbs',
'plugin-window-unhandled-rejection',
'plugin-window-onerror',
'plugin-strip-query-string',
'plugin-interaction-breadcrumbs',
'plugin-inline-script-content',
'plugin-simple-throttle',
'plugin-console-breadcrumbs',
'plugin-browser-session'
]),
project('react native', [
'react-native',
'delivery-react-native',
'plugin-react-native-app-state-breadcrumbs',
'plugin-react-native-connectivity-breadcrumbs',
'plugin-react-native-orientation-breadcrumbs',
'plugin-react-native-unhandled-rejection',
'plugin-react-native-hermes',
'plugin-react-native-client-sync',
'plugin-react-native-event-sync',
'plugin-react-native-global-error-handler',
'plugin-react-native-session',
'plugin-react-navigation',
'plugin-react-native-navigation'
], {
preset: 'react-native',
setupFiles: [
'<rootDir>/packages/react-native/src/test/setup.js'
]
}),
project('node plugins', [
'delivery-node',
'in-flight',
'plugin-aws-lambda',
'plugin-express',
'plugin-koa',
'plugin-restify',
'plugin-contextualize',
'plugin-server-*',
'plugin-strip-project-root',
'plugin-intercept',
'plugin-node-unhandled-rejection',
'plugin-node-in-project',
'plugin-node-device',
'plugin-node-surrounding-code',
'plugin-node-uncaught-exception'
], {
testEnvironment: 'node'
}),
project('node integration tests', [
], {
testEnvironment: 'node',
testMatch: [
'<rootDir>/packages/node/test/**/*.test.[jt]s',
'<rootDir>/packages/node/test/integration/**/*.test.[jt]s'
]
}),
project('electron', [
'delivery-electron',
'electron',
'electron-filestore',
'electron-test-helpers',
'electron-network-status',
'plugin-electron-app',
'plugin-electron-app-breadcrumbs',
'plugin-electron-client-state-manager',
'plugin-electron-client-state-persistence',
'plugin-electron-deliver-minidumps',
'plugin-electron-device',
'plugin-electron-ipc',
'plugin-electron-net-breadcrumbs',
'plugin-electron-network-status',
'plugin-electron-power-monitor-breadcrumbs',
'plugin-electron-preload-error',
'plugin-electron-process-info',
'plugin-electron-renderer-client-state-updates',
'plugin-electron-renderer-event-data',
'plugin-electron-renderer-strip-project-root',
'plugin-electron-screen-breadcrumbs',
'plugin-electron-session',
'plugin-internal-callback-marker'
], {
setupFilesAfterEnv: ['<rootDir>/test/electron/setup.ts'],
clearMocks: true,
modulePathIgnorePatterns: ['.verdaccio', 'fixtures']
}),
project('react native cli', ['react-native-cli'], { testEnvironment: 'node' })
]
}