forked from momentum-design/momentum-react-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
25 lines (23 loc) · 1.03 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 { pathsToModuleNameMapper } = require('ts-jest/utils'); // eslint-disable-line
const { compilerOptions } = require('./tsconfig.json'); // eslint-disable-line
const moduleMaps = pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' });
module.exports = {
preset: 'ts-jest',
moduleDirectories: ['node_modules', '<rootDir>/src'],
modulePathIgnorePatterns: ['<rootDir>/src/app/'],
snapshotSerializers: ['enzyme-to-json/serializer'],
snapshotResolver: '<rootDir>/config/jest/jest.snapshot-resolver.js',
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/src/helpers/enzyme_setup'],
transform: {
'^.+\\.(j|t)sx?$': 'ts-jest',
},
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',
...moduleMaps,
},
};