-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
136 lines (132 loc) · 5.06 KB
/
jest.config.js
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const TEST_REGEX = '(/__tests__/.*|(\\.|/)(test|spec))\\.(tsx?|ts?)$'
const path = require('path')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleNameMapper: {
'^@App/(.*)$': '<rootDir>/app/$1',
'^@TestUtils/(.*)$': '<rootDir>/jest/$1',
},
// transformIgnorePatterns: [
// "/node_modules/(?!(@remix-run|@web-std|)/).+\\.js$",
// "/node_modules/(?!(@remix-run|@web-std|)/).+\\.ts$",
// "/node_modules/(?!(@remix-run|@web-std|)/).+\\.tsx$",
// // "/node_modules/(?!(@remix-run/web-fetch|@remix-run/web-blob|@remix-run/web-stream|@remix-run/web-form-data|@remix-run/web-file|@web3-storage/multipart-parser)/)",
// ],
transformIgnorePatterns: [
"/node_modules/(?!(@remix-run/web-fetch|@remix-run/web-blob|@remix-run/web-stream|@remix-run/web-form-data|@remix-run/web-file|@web3-storage/multipart-parser)/).+\\.js$",
"/node_modules/(?!(@remix-run/web-fetch|@remix-run/web-blob|@remix-run/web-stream|@remix-run/web-form-data|@remix-run/web-file|@web3-storage/multipart-parser)/).+\\.ts$",
"/node_modules/(?!(@remix-run/web-fetch|@remix-run/web-blob|@remix-run/web-stream|@remix-run/web-form-data|@remix-run/web-file|@web3-storage/multipart-parser)/).+\\.tsx$",
],
transform: {
// "^.+\\.(js|ts)$": "ts-jest",
'^.+\\.tsx?$': [
'ts-jest',
{
// ts-jest configuration goes here
tsconfig: 'tsconfig.json',
},
],
},
// transform: {
// "\\.[jt]sx?$": [
// "babel-jest",
// { configFile: "./babel.config.js" },
// ],
// },
moduleDirectories: ['node_modules', path.join(__dirname, 'jest')],
moduleFileExtensions: [
'js',
"ts",
"tsx",
"json",
"node"
],
setupFiles: ["<rootDir>/jest/setup-tests.ts"],
setupFilesAfterEnv:[
'@testing-library/jest-dom/extend-expect',
],
testRegex: TEST_REGEX,
rootDir: "./",
verbose: true,
globals: {
// "ts-jest": {
// diagnostics: true,
// tsconfig: true
// }
},
collectCoverage: false,
// collectCoverageFrom: [
// "<rootDir>/app/**/*.{ts,tsx}",
// '!<rootDir>/app/components/blog/blogTemplate.tsx',
// '!<rootDir>/app/components/cards/tuesdayMakers/**',
// '!<rootDir>/app/components/footer/FooterPrimary.tsx',
// '!<rootDir>/app/components/footer/makersSignUpFooter.tsx',
// '!<rootDir>/app/components/forms/layout/**',
// '!<rootDir>/app/components/forms/dropdown/**',
// '!<rootDir>/app/components/layout/**',
// '!<rootDir>/app/components/lfm/closedPage.tsx',
// '!<rootDir>/app/components/layoutTemplates/**',
// '!<rootDir>/app/components/modals/modalTypes.ts',
// '!<rootDir>/app/components/modals/signUpInstructionsPopUp.tsx',
// '!<rootDir>/app/components/nav/nav.css',
// '!<rootDir>/app/components/nav/popOver/popOverMenuItems.tsx',
// '!<rootDir>/app/components/post/**',
// '!<rootDir>/app/components/products/productLayout.tsx',
// '!<rootDir>/app/components/resourceLibrary/resourceNav.tsx',
// '!<rootDir>/app/utils/cartUtils.ts',
// '!<rootDir>/app/utils/fetch.clent.ts',
// '!<rootDir>/app/utils/fetch.server.ts',
// '!<rootDir>/app/utils/windowUtils.ts',
// // '!<rootDir>/app/components/blog/**',
// // '!<rootDir>/app/components/buttons/**',
// // '!<rootDir>/app/components/cards/**',
// // '!<rootDir>/app/components/comments/**',
// // '!<rootDir>/app/components/footer/**',
// // '!<rootDir>/app/components/forms/**',
// // '!<rootDir>/app/components/gridDownloads/**',
// // '!<rootDir>/app/components/images/**',
// // '!<rootDir>/app/components/modals/**',
// // '!<rootDir>/app/components/nav/**',
// // '!<rootDir>/app/components/tabs/**',
// // '!<rootDir>/app/components/resourceLibrary/**',
// '!<rootDir>/app/components/seo/**',
// '!<rootDir>/app/components/sitemap/**',
// '!<rootDir>/app/components/svgs/**',
// '!<rootDir>/app/hooks/**',
// '!<rootDir>/app/lib/**',
// // '!<rootDir>/app/utils/**',
// "!<rootDir>/app/assets/**",
// "!<rootDir>/app/routes/**",
// "!<rootDir>/app/interfaces/**",
// "!<rootDir>/app/server/**",
// "!<rootDir>/app/enums/**",
// "!<rootDir>/app/styles/**",
// '!<rootDir>/app/cookies.server.ts',
// '!<rootDir>/app/sessions.server.ts',
// '!<rootDir>/app/entry.client.tsx',
// '!<rootDir>/app/entry.server.tsx',
// '!<rootDir>/app/root.tsx',
// '!<rootDir>/app/components/blog/blogHomeTabs/blogCategoryTabs.tsx',
// "!**/node_modules/**",
// "!**/build/**",
// "!**/.github/**",
// "!**/.cache/**",
// "!**/.vscode/**",
// "!**/githubActions/**",
// "!**/plugins/**",
// "!**/public/**",
// "!**/redirects/**",
// "!**/styles/**",
// ],
coverageReporters:["text-summary", ],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90
}
}
};