forked from ant-design/pro-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
39 lines (35 loc) · 1.31 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
const { readdirSync } = require('fs');
const { join } = require('path');
const pkgList = readdirSync(join(__dirname, './packages')).filter((pkg) => pkg.charAt(0) !== '.');
const moduleNameMapper = {
'\\.(css|less|sass|scss)$': require.resolve('identity-obj-proxy'),
};
pkgList.forEach((shortName) => {
const name = `@ant-design/pro-${shortName}`;
moduleNameMapper[name] = join(__dirname, `./packages/${shortName}/src`);
});
module.exports = {
collectCoverageFrom: [
'packages/**/src/**/*.{ts,tsx}',
'!packages/**/src/**/*.d.ts',
'!packages/**/src/demos/**',
'!packages/**/src/**/demos/**',
'!packages/utils/src/isDeepEqualReact/*.{ts,tsx}',
'!packages/utils/src/useMountMergeState/*.{ts,tsx}',
],
testEnvironment: 'jsdom',
moduleNameMapper,
transform: {
'^. \\.(t|j)sx?$': ['esbuild-jest', { sourcemap: true }],
},
transformIgnorePatterns: [`/node_modules/(?!${[].join('|')})`],
unmockedModulePathPatterns: ['node_modules/react/', 'node_modules/enzyme/'],
testURL:
'http://localhost?navTheme=realDark&layout=mix&colorPrimary=techBlue&splitMenus=false&fixedHeader=true',
verbose: true,
snapshotSerializers: [require.resolve('enzyme-to-json/serializer')],
setupFiles: ['./tests/setupTests.js'],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
},
};