-
Notifications
You must be signed in to change notification settings - Fork 58
/
jest.config.js
40 lines (40 loc) · 1.74 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
35
36
37
38
39
40
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',
'^gatsby-page-utils/(.*)$': 'gatsby-page-utils/dist/$1', // Workaround for https://github.com/facebook/jest/issues/9771
},
testMatch: ['**/?(*.)+(spec|test).ts?(x)', '**/?(*.)+(spec|test).js?(x)'],
testPathIgnorePatterns: ['node_modules', '.cache', 'playwright',
// @todo: remove skipped tests below after jest-resolve issue resolved.
// https://github.com/johnsonandjohnson/Bodiless-JS/issues/1533
'create-preview-pages.test.ts',
'create-pages.test.ts',
'gatsby-node.test.ts',
'js-data-type-stringify-utils.test.ts',
'renderer-bodiless.test.ts',
],
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
testResultsProcessor: 'jest-sonar-reporter',
globals: {
__PATH_PREFIX__: '',
BL_IS_EDIT: JSON.stringify(process.env.NODE_ENV !== 'production'),
'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'],
};