-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathjest.config.js
More file actions
26 lines (25 loc) · 1.27 KB
/
jest.config.js
File metadata and controls
26 lines (25 loc) · 1.27 KB
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
const { swcLoaderOptions } = require('./config/swc/loaderOptions'); // eslint-disable-line
module.exports = {
moduleDirectories: ['node_modules', '<rootDir>/src'],
modulePathIgnorePatterns: ['<rootDir>/src/app/'],
transformIgnorePatterns: [
// Note: this regex means, ignore everything except the listed packages after `?!`
'node_modules/(?!(@lit/react|lit|lit-html|lit-element|@lit/reactive-element|@lit/context|@momentum-design/components|@momentum-design/animations|element-internals-polyfill)/)',
],
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',
'\\@momentum-design/animations.*\\.json\\$': '<rootDir>/tools/reactionMock.js',
'^@momentum-ui/react-collaboration(.*)$': '<rootDir>/src',
},
testEnvironment: 'jsdom',
};