-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
37 lines (37 loc) · 1.05 KB
/
jest.config.js
File metadata and controls
37 lines (37 loc) · 1.05 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts', '**/*.spec.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/main.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
moduleNameMapper: {
'^obsidian$': '<rootDir>/test/mocks/obsidian.ts',
'^@codemirror/(.*)$': '<rootDir>/test/mocks/codemirror.ts',
'^codemirror$': '<rootDir>/test/mocks/codemirror.ts',
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: {
module: 'commonjs',
target: 'ES2020',
moduleResolution: 'node',
esModuleInterop: true,
allowJs: true,
strict: false,
skipLibCheck: true,
lib: ['ES2020', 'DOM'],
},
}],
},
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
testPathIgnorePatterns: ['/node_modules/', '/test/e2e/'],
verbose: true,
};