-
Notifications
You must be signed in to change notification settings - Fork 57
/
jest.config.js
25 lines (24 loc) · 1.12 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
const {swcLoaderOptions} = require('./config/swc/loaderOptions'); // eslint-disable-line
module.exports = {
moduleDirectories: ['node_modules', '<rootDir>/src'],
modulePathIgnorePatterns: ['<rootDir>/src/app/'],
transformIgnorePatterns: [
'node_modules/(?!(@lit/react|lit|lit-html|lit-element|@lit/reactive-element|@lit/context|@momentum-design/components)/)',
],
snapshotSerializers: ['enzyme-to-json/serializer'],
snapshotResolver: '<rootDir>/config/jest/jest.snapshot-resolver.js',
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/src/helpers/enzyme_setup.js'],
transform: {
'\\.[jt]sx?$': ['@swc/jest', swcLoaderOptions('typescript', 'test', false)],
},
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tools/assetsTransformer.js',
'\\.(scss|css|less)$': '<rootDir>/tools/assetsTransformer.js',
'\\.svg\\?svgr$': '<rootDir>/tools/svgMock.js',
'\\/reactions/.*\\.json\\?lottie$': '<rootDir>/tools/reactionMock.js',
'^@momentum-ui/react-collaboration(.*)$': '<rootDir>/src',
},
testEnvironment: 'jsdom'
};