forked from dewen/Bodiless-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
30 lines (30 loc) · 1.24 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 = {
transform: {
'^.+\\.jsx?$': '<rootDir>/config/jest-preprocess.js',
'^.+\\.tsx?$': 'ts-jest',
},
moduleNameMapper: {
// Uncomment lines below in case multiple react versions appear in the project to
// resolve react and react-dom to the same folder across multiple packages
// "^react(.*)$": "<rootDir>/node_modules/react$1",
// "^react-dom(.*)$": "<rootDir>/node_modules/react-dom$1",
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/config/__mocks__/fileMock.js',
},
testMatch: ['**/?(*.)+(spec|test).ts?(x)', '**/?(*.)+(spec|test).js?(x)'],
testPathIgnorePatterns: ['node_modules', '.cache', 'cypress'],
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
testResultsProcessor: 'jest-sonar-reporter',
globals: {
__PATH_PREFIX__: '',
'ts-jest': {
tsconfig: './config/tsconfig.test.json',
},
},
testURL: 'http://localhost',
setupFilesAfterEnv: ['<rootDir>/config/jestTestSetup'],
snapshotSerializers: ['enzyme-to-json/serializer'],
collectCoverageFrom: ['packages/**/src/**/*.ts(x)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};