forked from alibaba/hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
31 lines (30 loc) · 882 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
/** esm modules to transform */
const esmModules = [
// `query-string` and its related dependencies
'query-string',
'decode-uri-component',
'split-on-first',
'filter-obj',
];
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
clearMocks: true,
testPathIgnorePatterns: ['/.history/'],
modulePathIgnorePatterns: ['<rootDir>/package.json'],
resetMocks: false,
setupFiles: ['./jest.setup.js', 'jest-localstorage-mock'],
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
transform: {
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
},
collectCoverageFrom: [
'<rootDir>/**/src/**/*.{js,jsx,ts,tsx}',
'!**/demo/**',
'!**/example/**',
'!**/es/**',
'!**/lib/**',
'!**/dist/**',
],
transformIgnorePatterns: [`node_modules/(?!(?:.pnpm/)?(${esmModules.join('|')}))`],
};