-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
43 lines (33 loc) · 1.21 KB
/
jest.config.js
File metadata and controls
43 lines (33 loc) · 1.21 KB
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
const ig = ['node_modules', '.*/lib/.*'];
module.exports = {
testRegex: 'src/.*/?__tests__/.*.test\\.jsx?$',
setupFilesAfterEnv: ['./jest.setup.js'],
// Jest 29 requires explicit jsdom environment
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost',
},
testRunner: 'jest-circus/runner',
verbose: false,
testPathIgnorePatterns: ig,
// Transform ES modules from these packages
transformIgnorePatterns: ['node_modules/(?!(@mui|@emotion|@testing-library|@dnd-kit|@tiptap|@mapbox|d3-.*|lodash-es)(/|$))'],
// Custom resolver to handle node: protocol imports
resolver: '<rootDir>/jest-resolver.js',
moduleNameMapper: {
// CSS/Style imports
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
// Image imports
'\\.(jpg|jpeg|png|gif|svg|webp)$': '<rootDir>/__mocks__/fileMock.js',
// Workspace packages - map to source
'^@pie-lib/(.*)$': '<rootDir>/packages/$1/src',
'^d3-array$': '<rootDir>/node_modules/d3-array/dist/d3-array.js',
},
// Collect coverage from source files
collectCoverageFrom: [
'packages/*/src/**/*.{js,jsx}',
'!packages/*/src/**/*.d.ts',
'!packages/*/src/**/__tests__/**',
'!packages/*/src/**/__mocks__/**',
],
};