-
Notifications
You must be signed in to change notification settings - Fork 39
/
jest.config.js
33 lines (32 loc) · 945 Bytes
/
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
// Installing third-party modules by tnpm or cnpm will name modules with underscore as prefix.
// In this case _{module} is also necessary.
const esm = ['internmap', 'd3-*', 'lodash-es'].map((d) => `_${d}|${d}`).join('|');
module.exports = {
testTimeout: 100000,
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
isolatedModules: true,
tsconfig: {
target: 'esnext', // Increase test coverage.
allowJs: true,
sourceMap: true,
},
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
testRegex: '/__tests__/.*(-|\\.)spec\\.ts?$',
collectCoverageFrom: [
'src/**/*.ts',
'!**/checkbox/**',
'!**/button/**',
'!**/breadcrumb/**',
'!**/(countdown|statistic|link|toolbox)/**',
],
// Transform esm to cjs.
transformIgnorePatterns: [`<rootDir>/node_modules/(?!(?:.pnpm/)?(${esm}))`],
};