-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
25 lines (21 loc) · 789 Bytes
/
jest.config.js
File metadata and controls
25 lines (21 loc) · 789 Bytes
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
module.exports = {
// Look for test files in these directories
roots: [
'<rootDir>/src/app',
'<rootDir>/src/components',
'<rootDir>/src/constants',
'<rootDir>/src/hooks',
'<rootDir>/src/types',
],
// Jest will automatically look for test files with the following naming patterns
testMatch: [
'**/__tests__/**/*.[jt]s?(x)', // Any file in a __tests__ folder
'**/?(*.)+(spec|test).[tj]s?(x)' // Any file with .test or .spec in its name
],
// Optional: Test environment, typically "jsdom" for browser-like testing
testEnvironment: 'jest-environment-jsdom',
// Optional: Transpiler for TypeScript or JSX (if needed)
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
},
};