forked from trailheadapps/lwc-recipes-oss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
26 lines (24 loc) · 938 Bytes
/
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
// You only need this file
// - if you don't want to customize your Jest environment
// - if you don't want to use Jest i. e. from a Visual Studio Code extension
const { defaults } = require('jest-config');
const setupFilesAfterEnv = defaults.setupFilesAfterEnv || [];
setupFilesAfterEnv.push('<rootDir>/jest-sa11y-setup.js');
module.exports = {
preset: '@lwc/jest-preset',
moduleNameMapper: {
'^recipe/(.+)$': '<rootDir>/src/modules/recipe/$1/$1',
'^ui/(.+)$': '<rootDir>/jest-mocks/ui/$1/$1',
'data/wireGetContactListProvider':
'<rootDir>/jest-mocks/data/wireGetContactListProvider/wireGetContactListProvider',
'wired-elements': '<rootDir>/jest-mocks/wired-elements/wiredElements'
},
globals: {
'lwc-jest': {
nativeShadow: true
}
},
// Adding canvas mock for Chart.js tests
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv
};