generated from svierk/sfdx-project-starter-kit
-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathjest.config.js
34 lines (33 loc) · 1.53 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
const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config');
const setupFilesAfterEnv = jestConfig.setupFilesAfterEnv || [];
setupFilesAfterEnv.push('<rootDir>/jest-sa11y-setup.js');
setupFilesAfterEnv.push('jest-canvas-mock');
module.exports = {
...jestConfig,
testRegex: '/__tests__/.*.test.js$',
coverageReporters: ['clover', 'json', 'text', 'lcov', 'cobertura'],
modulePathIgnorePatterns: ['/.localdevserver'],
moduleNameMapper: {
'^lightning/actions$': '<rootDir>/force-app/test/jest-mocks/lightning/actions',
'^lightning/empApi$': '<rootDir>/force-app/test/jest-mocks/lightning/empApi',
'^lightning/flowSupport$': '<rootDir>/force-app/test/jest-mocks/lightning/flowSupport',
'^lightning/messageService$': '<rootDir>/force-app/test/jest-mocks/lightning/messageService',
'^lightning/modal$': '<rootDir>/force-app/test/jest-mocks/lightning/modal',
'^lightning/navigation$': '<rootDir>/force-app/test/jest-mocks/lightning/navigation',
'^lightning/platformShowToastEvent$': '<rootDir>/force-app/test/jest-mocks/lightning/platformShowToastEvent',
'^lightning/platformWorkspaceApi$': '<rootDir>/force-app/test/jest-mocks/lightning/platformWorkspaceApi',
'^lightning/refresh$': '<rootDir>/force-app/test/jest-mocks/lightning/refresh',
'^lightning/uiRecordApi$': '<rootDir>/force-app/test/jest-mocks/lightning/uiRecordApi'
},
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'tests',
outputName: 'test-results-lwc.xml'
}
]
],
setupFilesAfterEnv
};