-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.cjs
46 lines (41 loc) · 1.17 KB
/
jest.config.cjs
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
// TODO: re-enable once https://github.com/salesforce/sa11y/issues/356 is resolved
// const setupFilesAfterEnv = jestConfig.setupFilesAfterEnv || []
// setupFilesAfterEnv.push('<rootDir>/jest-sa11y-setup.js')
console.log(`Using "jest.config.cjs"`)
/** @type {import('jest').Config} */
function integration({ nativeShadow }) {
return {
rootDir: './force-app/',
displayName: {
name: `integration (${nativeShadow ? 'native' : 'synthetic'} shadow)`,
color: nativeShadow ? 'blue' : 'cyan'
},
transform: {
'^.+\\.(js|html|css)$': require.resolve('@lwc/jest-transformer'),
},
preset: '@lwc/jest-preset',
moduleNameMapper: {
"^@salesforce/community/Id": "<rootDir>/../__mocks__/lwc/@salesforce/community/Id.js",
"^c/(.+)$": "<rootDir>/main/default/lwc/$1/$1"
},
globals: {
'lwc-jest': {
nativeShadow
}
},
}
}
module.exports = {
collectCoverage: true,
collectCoverageFrom: ['./**'],
coverageReporters: ['json', 'html', 'lcov'],
coverageThreshold: {
global: {
lines: 90,
},
},
projects: [
integration({ nativeShadow: false }),
integration({ nativeShadow: true }),
],
}