-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest-addon.config.js
67 lines (67 loc) · 2.51 KB
/
jest-addon.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
module.exports = {
verbose: true,
transform: {
'.+\\.[jt]sx?$': 'babel-jest',
'^.+\\.png$': 'jest-file',
'^.+\\.jpg$': 'jest-file',
// '^.+\\.svg$':
// '<rootDir>/node_modules/@plone/volto/jest-svgsystem-transform.js',
},
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
modulePathIgnorePatterns: [
'<rootDir>/src/addons/design-comuni-plone-theme/addon-testing-project',
'<rootDir>/src/addons/design-comuni-plone-theme/project',
],
transformIgnorePatterns: [
'node_modules/(?!(volto-slate|@plone/volto|design-react-kit|volto-))',
],
moduleNameMapper: {
'\\.(css|less|scss|sass|svg)$': 'identity-obj-proxy',
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
'@plone/volto-slate/(.*)$':
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
'@package/(.*)$': '<rootDir>/src/$1',
'@root/(.*)$': '<rootDir>/src/$1',
'~/(.*)$': '<rootDir>/src/$1',
'load-volto-addons':
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
'^design-comuni-plone-theme/icons/fontawesome-free-6.4.0-web/svgs/\\${prefixFolder}/\\${iconName}\\.svg':
'<rootDir>/src/addons/design-comuni-plone-theme/src/icons/fontawesome-free-6.4.0-web/svgs/regular/moon.svg',
'^design-comuni-plone-theme/(.*)$':
'<rootDir>/src/addons/design-comuni-plone-theme/src/$1',
'^volto-gdpr-privacy/(.*)$':
'<rootDir>/node_modules/volto-gdpr-privacy/src/$1',
'^volto-venue/(.*)$': '<rootDir>/node_modules/volto-venue/src/$1',
'^volto-data-grid-widget/(.*)$':
'<rootDir>/node_modules/volto-data-grid-widget/src/$1',
'^volto-dropdownmenu/(.*)$':
'<rootDir>/node_modules/volto-dropdownmenu/src/$1',
'^volto-feedback/(.*)$': '<rootDir>/node_modules/volto-feedback/src/$1',
'^volto-blocks-widget/(.*)$':
'<rootDir>/node_modules/volto-blocks-widget/src/$1',
},
collectCoverage: false,
collectCoverageFrom: [
'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
],
coverageThreshold: {
global: {
branches: 5,
functions: 5,
lines: 5,
statements: 5,
},
},
setupFiles: [
'@plone/volto/test-setup-globals.js',
'@plone/volto/test-setup-config.js',
'./src/addons/design-comuni-plone-theme/test-setup-config.js',
],
globalSetup: '@plone/volto/global-test-setup.js',
globals: {
__DEV__: true,
},
};