Skip to content

Commit 272727b

Browse files
committed
Fix Jest config to properly find test files
- Added explicit rootDir: '..' to set project root - Updated all path references to use correct <rootDir> base - Resolves 'No tests found' error in CI - Now properly finds and runs 69 tests (58 passing, 11 pre-existing failures)
1 parent 8058564 commit 272727b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

config/jest.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
module.exports = {
2+
// Set root directory to project root (one level up from config/)
3+
rootDir: '..',
4+
25
// Test environment
36
testEnvironment: 'jsdom',
47

58
// Test match patterns
69
testMatch: [
7-
'<rootDir>/../tests/unit/**/*.test.js',
8-
'<rootDir>/../tests/integration/**/*.test.js'
10+
'<rootDir>/tests/unit/**/*.test.js',
11+
'<rootDir>/tests/integration/**/*.test.js'
912
],
1013

1114
// Coverage configuration
1215
collectCoverageFrom: [
13-
'<rootDir>/../src/**/*.js',
14-
'!<rootDir>/../src/**/*.test.js',
16+
'<rootDir>/src/**/*.js',
17+
'!<rootDir>/src/**/*.test.js',
1518
'!**/node_modules/**',
1619
'!**/dist/**'
1720
],
@@ -43,7 +46,7 @@ module.exports = {
4346
},
4447

4548
// Setup files
46-
setupFilesAfterEnv: ['<rootDir>/../tests/setup.js'],
49+
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
4750

4851
// Ignore patterns
4952
testPathIgnorePatterns: [

0 commit comments

Comments
 (0)