forked from trailheadapps/lwc-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
36 lines (36 loc) · 1.66 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
const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config');
const setupFilesAfterEnv = jestConfig.setupFilesAfterEnv || [];
setupFilesAfterEnv.push('<rootDir>/jest-sa11y-setup.js');
module.exports = {
...jestConfig,
moduleNameMapper: {
/* CSS library import fix in test context. See:
https://github.com/salesforce/sfdx-lwc-jest/issues/288) */
'^c/cssLibrary$':
'<rootDir>/force-app/main/default/lwc/cssLibrary/cssLibrary.css',
// Jest mocks
'^@salesforce/apex$': '<rootDir>/force-app/test/jest-mocks/apex',
'^@salesforce/schema$': '<rootDir>/force-app/test/jest-mocks/schema',
'^lightning/navigation$':
'<rootDir>/force-app/test/jest-mocks/lightning/navigation',
'^lightning/platformShowToastEvent$':
'<rootDir>/force-app/test/jest-mocks/lightning/platformShowToastEvent',
'^lightning/uiRecordApi$':
'<rootDir>/force-app/test/jest-mocks/lightning/uiRecordApi',
'^lightning/messageService$':
'<rootDir>/force-app/test/jest-mocks/lightning/messageService',
'^lightning/actions$':
'<rootDir>/force-app/test/jest-mocks/lightning/actions',
'^lightning/alert$':
'<rootDir>/force-app/test/jest-mocks/lightning/alert',
'^lightning/confirm$':
'<rootDir>/force-app/test/jest-mocks/lightning/confirm',
'^lightning/prompt$':
'<rootDir>/force-app/test/jest-mocks/lightning/prompt',
'^lightning/modal*':
'<rootDir>/force-app/test/jest-mocks/lightning/modal'
},
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv,
testTimeout: 10000
};