-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
59 lines (58 loc) · 2.08 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
const testMatchPrefix = process.env.PACKAGE ? `**/packages/${process.env.PACKAGE}/src/**` : '**';
const collectCoveragePrefix = process.env.PACKAGE ? process.env.PACKAGE : '**';
module.exports = {
// testEnvironment: 'node',
testMatch:
process.env.E2E === 'none'
? [`${testMatchPrefix}/?*.(spec|test).(j|t)s?(x)`]
: [`${testMatchPrefix}/?*.(spec|test|e2e).(j|t)s?(x)`],
moduleNameMapper: {
'^umi/_runtimePlugin$': require.resolve('./packages/umi/lib/runtimePlugin'),
'^@tmp/history': require.resolve('./packages/umi/lib/createHistory'),
},
testPathIgnorePatterns: [
'/.git/',
'/node_modules/',
'/examples/',
'/lib/',
'/packages/umi/src/scripts/test.js',
'/packages/umi/src/test.js',
'/packages/umi-build-dev/src/fixtures',
'/packages/umi-build-dev/src/routes/fixtures',
'/packages/umi-plugin-dva/src/fixtures',
'/packages/umi-utils/src/fixtures',
'/packages/umi-ui-tasks/src/dist',
'/packages/umi/test/fixtures',
],
setupFilesAfterEnv: ['./jasmine.js'],
collectCoverageFrom: [
`packages/${collectCoveragePrefix}/src/**/*.{js,jsx,ts,tsx}`,
'!**/ui.umd.js',
'!**/fixtures/**',
'!**/ui/**',
'!**/examples/**',
'!**/locales/**',
'!**/typings/**',
'!**/types/**',
],
coveragePathIgnorePatterns: [
'/packages/af-webpack/src/clearConsole.js',
'/packages/af-webpack/src/fork.js',
'/packages/af-webpack/src/formatWebpackMessages.js',
'/packages/af-webpack/src/patchConnection.js',
'/packages/af-webpack/src/registerBabel.js',
'/packages/af-webpack/src/socket.js',
'/packages/af-webpack/src/svgr.js',
'/packages/af-webpack/src/webpackHotDevClient.js',
'/packages/umi/src/cli.js',
'/packages/umi/src/createHistory.js',
'/packages/umi/src/router.js',
'/packages/umi/src/scripts',
'/packages/babel-preset-umi/src/webpack-overrides.js',
'/packages/eslint-config-umi',
'/packages/umi-plugin-auto-externals/src/types',
'/packages/umi-ui/client',
'/packages/umi-test',
'/packages/umi-build-dev/src/plugins/commands/generate/generators',
],
};