forked from callumalpass/tasknotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
44 lines (44 loc) · 1.6 KB
/
jest.config.js
File metadata and controls
44 lines (44 loc) · 1.6 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
44
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.ts',
'**/?(*.)+(spec|test).ts'
],
transform: {
'^.+\\.ts$': 'ts-jest',
},
setupFilesAfterEnv: ['<rootDir>/tests/test-setup.ts'],
moduleNameMapper: {
'^tasknotes-nlp-core$': '<rootDir>/../tasknotes-nlp-core/src/index.ts',
'^obsidian$': '<rootDir>/tests/__mocks__/obsidian.ts',
'^@fullcalendar/(.*)$': '<rootDir>/tests/__mocks__/fullcalendar.ts',
// Keep mocks for complex/large libraries that benefit from controlled testing
'^chrono-node$': '<rootDir>/tests/__mocks__/chrono-node.ts',
'^ical.js$': '<rootDir>/tests/__mocks__/ical.ts',
// Add ES module mocks for problematic imports
'^yaml$': '<rootDir>/tests/__mocks__/yaml.ts',
'^rrule$': '<rootDir>/tests/__mocks__/rrule.ts',
'^date-fns$': '<rootDir>/tests/__mocks__/date-fns.ts',
// Mock utility modules
'^../../src/utils/helpers$': '<rootDir>/tests/__mocks__/utils.ts',
'^../../src/utils/filenameGenerator$': '<rootDir>/tests/__mocks__/utils.ts',
'^../../src/utils/dateUtils$': '<rootDir>/tests/__mocks__/utils.ts',
// Mock markdown files (for release notes)
'\\.md$': '<rootDir>/tests/__mocks__/markdown.ts'
},
collectCoverageFrom: [
'src/services/**/*.ts',
'src/utils/**/*.ts',
'!src/services/PriorityManager.ts',
'!src/services/StatusManager.ts',
'!src/services/FieldMapper.ts',
'!src/**/*.d.ts',
'!tests/**/*'
],
coverageReporters: ['text', 'lcov', 'html'],
testTimeout: 10000,
clearMocks: true,
restoreMocks: true
};