-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
58 lines (56 loc) · 1.67 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
import type { Config } from '@jest/types'
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'node',
clearMocks: true,
collectCoverage: true,
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['json', 'html', 'lcov'],
collectCoverageFrom: [
'./src/**/agenda/*.{js,ts,tsx,jsx}',
'./src/**/feed/*.{js,ts,tsx,jsx}',
'./src/**/pesquisa/*.{js,ts,tsx,jsx}',
'./src/**/denuncia/[id]/*.{js,ts,tsx,jsx}',
'./src/**/auth/*.{js,ts,tsx,jsx}',
'./src/**/imovel/*.{js,ts,tsx,jsx}',
'./src/**/perfil/[id]/perfilUtils/*.{js,ts,tsx,jsx}',
'./src/**/plano/*.{js,ts,tsx,jsx}',
'./src/**/survey/[id]/*.{js,ts,tsx,jsx}',
'./src/**/chat/[[...idsala]]/*.{js,ts,tsx,jsx}',
'./src/**/(navbar)/*.{js,ts,tsx,jsx}',
'./src/**/(navbar)/*.{js,ts,tsx,jsx}',
'!**/node_modules/**',
'!**/vendor/**',
'!**/vendor/**',
],
transform: {
'\\.tsx$': ['babel-jest', { configFile: './babel.config.testing.js' }],
'\\.ts$': ['babel-jest', { configFile: './babel.config.testing.js' }],
// "\\.tsx?$": "babel-jest",
// "\\.ts?$": "babel-jest",
// '\\.tsx?$': ["ts-jest", {
// babelConfig: true
// }],
// '\\.ts?$': ["ts-jest", {
// babelConfig: true
// }],
},
setupFiles: ["<rootDir>/.jest/env.js"],
transformIgnorePatterns: [
"/node_modules/(?!test-component).+\\.js$"
],
moduleNameMapper: {
"react": 'next/dist/compiled/react/cjs/react.development.js',
'^@/(.*)$': '<rootDir>/src/$1',
},
moduleFileExtensions: [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
export default config