forked from toptal/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
34 lines (32 loc) · 1.3 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
31
32
33
34
module.exports = {
roots: ['<rootDir>/packages'],
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest'
},
setupFiles: ['jest-canvas-mock', './jest-setup-dom.js'],
testMatch: ['**/(test).(js|jsx|ts|tsx)'],
testPathIgnorePatterns: ['/node_modules/', '/dist-package', '/build'],
setupFilesAfterEnv: ['./jest-setup.ts'],
/*
jss-snapshot-serializer is needed to remove dynamically
generated parts of classNames from material-ui components
https://github.com/mui-org/material-ui/issues/9492
*/
snapshotSerializers: ['./__tests__/jss-snapshot-serializer.js'],
/*
Let Jest to replace import of any files with those extensions with
the mock file ./__tests__/file-mock.js
*/
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|webp|svg|ttf|woff|woff2)$':
'<rootDir>/__tests__/fileMock.js',
'^@toptal/picasso/(.*)$': '<rootDir>/packages/picasso/src/$1',
'^@toptal/picasso-lab/(.*)$': '<rootDir>packages/picasso-lab/src/$1',
'^@toptal/picasso-shared$': '<rootDir>packages/shared/src/index.ts',
'^@toptal/picasso$': '<rootDir>packages/picasso/src/index.ts',
'^@toptal/picasso-lab$': '<rootDir>packages/picasso-lab/src/index.ts',
'^@toptal/picasso-provider$':
'<rootDir>packages/picasso-provider/src/index.ts'
},
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx']
}