-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (29 loc) · 805 Bytes
/
jest.config.js
File metadata and controls
29 lines (29 loc) · 805 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
26
27
28
29
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: {
esModuleInterop: true,
allowSyntheticDefaultImports: true,
module: 'commonjs',
},
}],
},
moduleNameMapper: {
'^obsidian$': '<rootDir>/test/mocks/obsidian.ts',
// Mock d3 and other ES module dependencies
'^d3$': '<rootDir>/test/mocks/d3.ts',
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
],
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
// Transform ES modules in node_modules
transformIgnorePatterns: [
'node_modules/(?!(d3|d3-.*|moment)/)',
],
};