-
Notifications
You must be signed in to change notification settings - Fork 31
/
jest.config.ts
94 lines (90 loc) · 3.56 KB
/
jest.config.ts
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import type { JestConfigWithTsJest } from 'ts-jest'
const ESM_MODULES = [
'roughjs',
'points-on-curve',
'path-data-parser',
'points-on-path',
'browser-fs-access',
'nanoid'
]
// npx jest 2>&1 | grep 'FAIL'
const IGNORE_PATTERNS = [
'imports/excalidraw/tests/export.test.tsx',
'imports/excalidraw/tests/linearElementEditor.test.tsx',
'imports/excalidraw/tests/clipboard.test.tsx',
'imports/excalidraw/tests/align.test.tsx',
'imports/excalidraw/tests/packages/excalidraw.test.tsx',
'imports/excalidraw/element/textWysiwyg.test.tsx',
'imports/excalidraw/tests/contextmenu.test.tsx',
'imports/excalidraw/tests/resize.test.tsx',
'imports/excalidraw/tests/scene/export.test.ts',
'imports/excalidraw/tests/data/restore.test.ts',
'imports/excalidraw/tests/selection.test.tsx',
'imports/excalidraw/tests/zindex.test.tsx',
'imports/excalidraw/tests/viewMode.test.tsx',
'imports/excalidraw/tests/dragCreate.test.tsx',
'imports/excalidraw/tests/elementLocking.test.tsx',
'imports/excalidraw/tests/regressionTests.test.tsx',
'imports/excalidraw/tests/packages/utils.test.ts',
'imports/excalidraw/tests/multiPointCreate.test.tsx',
'imports/excalidraw/tests/move.test.tsx',
'imports/excalidraw/tests/charts.test.tsx',
'imports/excalidraw/tests/binding.test.tsx',
'imports/excalidraw/tests/appState.test.tsx',
'imports/excalidraw/actions/actionStyles.test.tsx',
'imports/excalidraw/tests/history.test.tsx',
'imports/excalidraw/tests/collab.test.tsx',
'imports/excalidraw/components/Sidebar/Sidebar.test.tsx',
'imports/excalidraw/tests/export.test.tsx',
'imports/excalidraw/tests/linearElementEditor.test.tsx',
'imports/excalidraw/tests/clipboard.test.tsx',
'imports/excalidraw/tests/align.test.tsx',
'imports/excalidraw/tests/packages/excalidraw.test.tsx',
'imports/excalidraw/element/textWysiwyg.test.tsx',
'imports/excalidraw/tests/contextmenu.test.tsx',
'imports/excalidraw/tests/resize.test.tsx',
'imports/excalidraw/tests/scene/export.test.ts',
'imports/excalidraw/tests/data/restore.test.ts',
'imports/excalidraw/tests/selection.test.tsx',
'imports/excalidraw/tests/zindex.test.tsx',
'imports/excalidraw/tests/viewMode.test.tsx',
'imports/excalidraw/tests/dragCreate.test.tsx',
'imports/excalidraw/tests/elementLocking.test.tsx',
'imports/excalidraw/tests/regressionTests.test.tsx',
'imports/excalidraw/tests/packages/utils.test.ts',
'imports/excalidraw/tests/multiPointCreate.test.tsx',
'imports/excalidraw/tests/move.test.tsx',
'imports/excalidraw/tests/charts.test.tsx',
'imports/excalidraw/tests/binding.test.tsx',
'imports/excalidraw/tests/appState.test.tsx',
'imports/excalidraw/actions/actionStyles.test.tsx',
'imports/excalidraw/tests/history.test.tsx',
'imports/excalidraw/tests/collab.test.tsx',
'imports/excalidraw/components/Sidebar/Sidebar.test.tsx',
'imports/excalidraw/tests/library.test.tsx'
]
const jestConfig: JestConfigWithTsJest = {
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
// ignore stylesheets files
// See: https://stackoverflow.com/a/50572999
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^(\\.{1,2}/.*)\\.js$': '$1',
'\\/imports\\/(.+)': '<rootDir>/imports/$1',
'meteor/.+': 'identity-obj-proxy'
},
transform: {
'^.+\\.m?[tj]sx?$': [
'ts-jest',
{
useESM: true,
isolatedModules: true
}
]
},
transformIgnorePatterns: [`node_modules/(?!(${ESM_MODULES.join('|')})/)`],
setupFilesAfterEnv: ['./tests/setupTests.ts'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: IGNORE_PATTERNS
}
export default jestConfig