-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.frontend.js
More file actions
40 lines (40 loc) · 1.95 KB
/
Copy pathjest.config.frontend.js
File metadata and controls
40 lines (40 loc) · 1.95 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
/**
* Jest configuration for frontend tests (hooks, components, machines)
*/
module.exports = {
testEnvironment: 'jsdom',
coveragePathIgnorePatterns: ['/node_modules/'],
testMatch: ['**/tests/hooks/**/*.test.js', '**/tests/machines/**/*.test.js', '**/tests/components/**/*.test.js', '**/tests/views/**/*.test.jsx'],
setupFilesAfterEnv: ['<rootDir>/tests/setupTests.js'],
testTimeout: 30000,
verbose: true,
collectCoverageFrom: [
'src/hooks/**/*.js',
'src/machines/**/*.js',
'src/components/**/*.jsx',
'!**/node_modules/**',
'!**/build/**',
'!**/tests/**',
],
moduleNameMapper: {
'\\.(css|less)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/tests/__mocks__/fileMock.js',
// Resolve @ark-ui/react subpath imports — Jest 27 can't handle wildcard exports patterns.
// Special subpaths (non-component) must be listed before the catch-all.
'^@ark-ui/react/anatomy$': '<rootDir>/node_modules/@ark-ui/react/dist/components/anatomy.cjs',
'^@ark-ui/react/factory$': '<rootDir>/node_modules/@ark-ui/react/dist/components/factory.cjs',
'^@ark-ui/react/environment$': '<rootDir>/node_modules/@ark-ui/react/dist/providers/environment/index.cjs',
'^@ark-ui/react/locale$': '<rootDir>/node_modules/@ark-ui/react/dist/providers/locale/index.cjs',
'^@ark-ui/react/utils$': '<rootDir>/node_modules/@ark-ui/react/dist/utils/index.cjs',
// Catch-all: component subpaths (e.g. @ark-ui/react/menu → dist/components/menu/index.cjs)
'^@ark-ui/react/(.+)$': '<rootDir>/node_modules/@ark-ui/react/dist/components/$1/index.cjs'
},
transform: {
'^.+\\.(js|jsx|mjs|cjs)$': 'babel-jest'
},
transformIgnorePatterns: [
// Transform ESM-only packages through babel-jest so Jest can parse them.
// These packages ship "type": "module" in their package.json.
'/node_modules/(?!(@chakra-ui|@ark-ui|proxy-compare|uqr|.*\\.mjs$))'
]
};