-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.ts
More file actions
54 lines (52 loc) · 1.55 KB
/
jest.config.ts
File metadata and controls
54 lines (52 loc) · 1.55 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
45
46
47
48
49
50
51
52
53
54
import type { Config } from '@jest/types'
const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/specs/**/*.test.ts',
'<rootDir>/specs/**/*.spec.ts'
],
// Временно исключаем проблемный тест
testPathIgnorePatterns: [
// '<rootDir>/specs/src/main.spec.ts'
],
moduleFileExtensions: [
'ts',
'js',
'json'
],
transform: {
'\\.[jt]s$': ['ts-jest', {
diagnostics: false
}]
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^nanoid$': '<rootDir>/specs/__mocks__/nanoid.ts',
'^fabric$': '<rootDir>/specs/__mocks__/fabric.ts',
'^jsondiffpatch/with-text-diffs$': '<rootDir>/specs/__mocks__/jsondiffpatch.ts',
'^jsondiffpatch$': '<rootDir>/specs/__mocks__/jsondiffpatch.ts',
'\\?worker$': '<rootDir>/specs/__mocks__/worker.ts'
},
transformIgnorePatterns: [
'node_modules/(?!(nanoid|fabric|jsondiffpatch)/)'
],
setupFilesAfterEnv: ['<rootDir>/specs/setupTests.ts'],
// Настройка сбора покрытия только для editor-кода
collectCoverageFrom: [
'src/editor/**/*.{ts,js}',
'!src/editor/**/*.d.ts',
'!src/editor/**/*.test.ts',
'!src/editor/**/*.spec.ts'
]
// Убираем пороги покрытия чтобы низкое покрытие не считалось ошибкой
// coverageThreshold: {
// global: {
// branches: 50,
// functions: 50,
// lines: 50,
// statements: 50
// }
// }
}
export default config