forked from novasamatech/nova-spektr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
68 lines (66 loc) · 1.93 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
import type { Config } from 'jest';
const swcConfig = {
sourceMaps: 'inline',
jsc: {
parser: {
target: 'es2021',
syntax: 'typescript',
jsx: true,
tsx: true,
dynamicImport: true,
allowJs: true,
},
transform: {
react: {
pragma: 'React.createElement',
pragmaFrag: 'React.Fragment',
runtime: 'automatic',
},
},
},
};
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
coverageReporters: ['json-summary', 'text', 'text-summary'],
setupFilesAfterEnv: ['@testing-library/jest-dom'],
coverageThreshold: {
global: {
branches: 25,
functions: 47,
lines: 50,
statements: 50,
},
},
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', swcConfig],
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|json)$)': '<rootDir>/scripts/fileTransform.js',
},
transformIgnorePatterns: [],
testRegex: ['^.*\\.(test|spec)\\.[jt]sx?$'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^raptorq$': '<rootDir>/node_modules/raptorq/raptorq.js',
'^@renderer(.*)$': '<rootDir>/src/renderer/$1',
'^@app(.*)$': '<rootDir>/src/renderer/app/$1',
'^@pages(.*)$': '<rootDir>/src/renderer/pages/$1',
'^@widgets(.*)$': '<rootDir>/src/renderer/widgets/$1',
'^@features(.*)$': '<rootDir>/src/renderer/features/$1',
'^@entities(.*)$': '<rootDir>/src/renderer/entities/$1',
'^@shared(.*)$': '<rootDir>/src/renderer/shared/$1',
'^dexie$': '<rootDir>/node_modules/dexie/dist/dexie.js',
'^lottie': 'lottie-react',
},
modulePathIgnorePatterns: ['<rootDir>/tests'],
collectCoverageFrom: [
'src/renderer/**/*.{js,ts}',
'!src/renderer/pages/**/*.{js,ts}',
'!src/main/',
'!src/scripts/',
'!src/**/*.stories.{js,jsx,ts,tsx}',
'!<rootDir>/node_modules/',
],
reporters: ['default', 'jest-junit'],
setupFiles: [`<rootDir>/jest-setup.js`],
};
export default config;