-
Notifications
You must be signed in to change notification settings - Fork 46
/
jest.config.js
30 lines (30 loc) · 1.41 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
module.exports = {
clearMocks: true,
collectCoverage: false,
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/messages.{ts,tsx}', '!**/node_modules/**'],
coverageDirectory: '<rootDir>/reports',
globals: {
__NAME__: 'name',
__VERSION__: 'version',
__LANGUAGE__: 'en-US',
},
moduleNameMapper: {
'\\.(css|scss|less|html)$': '<rootDir>/scripts/jest/styleMock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)$': '<rootDir>/scripts/jest/fileMock.js',
'@popperjs/core': '<rootDir>/scripts/jest/popperMock.js',
'box-annotations-locale-data': '<rootDir>/scripts/jest/i18nMock.js',
'box-elements-messages': '<rootDir>/scripts/jest/i18nMock.js',
'react-intl': '<rootDir>/scripts/jest/react-intl-mock.js',
'react-intl-locale-data': '<rootDir>/node_modules/react-intl/locale-data/en.js',
mousetrap: '<rootDir>/scripts/jest/moduleMock.js',
rangy: '<rootDir>/scripts/jest/moduleMock.js',
},
modulePathIgnorePatterns: ['__mocks__'],
restoreMocks: true,
roots: ['src'],
setupFiles: ['jest-canvas-mock', '<rootDir>/scripts/jest/envWindow.js'],
setupFilesAfterEnv: ['<rootDir>/scripts/jest/enzyme-adapter.js'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jest-environment-jsdom-sixteen',
transformIgnorePatterns: ['node_modules/(?!(box-ui-elements)/)'],
};