-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathjest.config.js
64 lines (64 loc) · 2.35 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
const paths = require('./scripts/config/paths');
module.exports = {
verbose: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx,mjs}'],
setupFiles: [
'<rootDir>/node_modules/regenerator-runtime/runtime',
'<rootDir>/scripts/config/polyfills.js'
],
moduleNameMapper: {
"^@root(.*)$": "<rootDir>/src/types$1",
"^@utils(.*)$": "<rootDir>/src/helpers/utils$1",
"^@config(.*)$": "<rootDir>/src/config$1",
"^@helpers(.*)$": "<rootDir>/src/helpers$1",
"^@universal-schema(.*)$": "<rootDir>/src/universal-schema$1",
"^@cross-framework-wrapper(.*)$": "<rootDir>/src/cross-framework-wrapper$1",
"^@generated(.*)$": "<rootDir>/src/framework/generated$1",
"^@framework(.*)$": "<rootDir>/src/framework$1",
},
snapshotSerializers: ['enzyme-to-json/serializer'],
setupFilesAfterEnv: ['<rootDir>/scripts/config/jest/setup.js'],
testMatch: [
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}',
],
coverageDirectory: '<rootDir>/coverage',
coveragePathIgnorePatterns: [
// All type definitions to be excluded
'!*.d.ts',
'!*.type.ts',
// Ingore Mobile files - will be covered seperately
'!*.native.ts',
'!*.native.tsx',
// All Ignore files should be covered by E2E Tests to get maximum coverage.
'<rootDir>/node_modules',
// Ignore Demo folder
'<rootDir>/src/demo',
// Ignore E2E Folder
'<rootDir>/src/__e2e__',
'<rootDir>/src/generated',
// Ignore Compiled folders
'<rootDir>/src/index.ts',
'<rootDir>/src/fields/components/(Checkbox|CreatableSelect|Input|EmptyDiv|MaterialSelect|RadioGroup|ReactSelect|RichTextEditor)/dist',
'<rootDir>/src/parsers/(enum-utils|parse-values)/dist',
'<rootDir>/src/fields/interceptors/(translate-currency|translate-range-date|translate-ratings)/dist',
],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx|mjs)$': ['babel-jest', { configFile: paths.babelConfig }],
'\\.(ts|tsx)$': [
'ts-jest',
{
useESM: true,
},
],
'^.+\\.css$': '<rootDir>/scripts/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|mjs|css|json)$)':
'<rootDir>/scripts/config/jest/fileTransform.js'
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx|mjs)$'
],
moduleDirectories: paths.resolveModules,
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'mjs']
};