-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathjest.config.js
More file actions
45 lines (43 loc) · 1.7 KB
/
jest.config.js
File metadata and controls
45 lines (43 loc) · 1.7 KB
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
/*
* Copyright (c) 2022, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const path = require('path')
const base = require('@salesforce/pwa-kit-dev/configs/jest/jest.config.js')
module.exports = {
...base,
moduleNameMapper: {
...base.moduleNameMapper,
'^react$': '<rootDir>/node_modules/react/index.js',
'^react-router-dom(.*)$': '<rootDir>/node_modules/react-router-dom/index.js',
'^@tanstack/react-query$':
'<rootDir>/node_modules/@tanstack/react-query/build/lib/index.js',
'^is-what$': '<rootDir>/node_modules/is-what/dist/cjs/index.cjs',
'^copy-anything$': '<rootDir>/node_modules/copy-anything/dist/cjs/index.cjs',
"^@salesforce/cc-datacloud-typescript$": "<rootDir>/node_modules/@salesforce/cc-datacloud-typescript/dist/index.js",
},
setupFilesAfterEnv: [path.join(__dirname, 'jest-setup.js')],
collectCoverageFrom: [
'src/pages/**/*.{js,jsx}',
'src/components/**/*.{js,jsx}',
'src/hooks/**/*.{js,jsx}',
'src/utils/**/*.{js,jsx}',
'src/contexts/**/*.{js,jsx}',
'src/page-designer/**/*.{js,jsx}',
'!**/node_modules/**',
'!**/dist/**'
],
//@TODO: Revert this threshold back to original numbers stattements: 80, branches: 72, functions: 78, lines: 83
coverageThreshold: {
global: {
statements: 73,
branches: 60,
functions: 65,
lines: 74
}
},
// Increase to: 6 x default timeout of 5 seconds
...(process.env.CI ? {testTimeout: 30000} : {})
}