-
Notifications
You must be signed in to change notification settings - Fork 150
/
jest.config.js
50 lines (49 loc) · 1.45 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
41
42
43
44
45
46
47
48
49
50
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'src/components/**/*.js',
'src/internal/components/**/*.js',
'!src/components/**/*.stories.js',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'html'],
setupFiles: ['<rootDir>/config/jest/setup.js', 'raf/polyfill'],
setupFilesAfterEnv: ['../../tasks/jest/setupafter.js'],
testMatch: [
'<rootDir>/**/__tests__/**/*.test.js?(x)',
'<rootDir>/**/?(*-)(spec|test).js?(x)',
'!<rootDir>/**/bundle-size.test.js',
'!**/vendor/**',
],
testRunner: 'jest-circus/runner',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx)$': '<rootDir>/config/jest/jsTransform.js',
'^.+\\.s?css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
testPathIgnorePatterns: [
'/node_modules/',
'/examples/',
'/config/',
'/lib/',
'/es/',
'/cjs/',
'/gulp-tasks/',
],
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\](?!(carbon-icons)).+\\.(js|jsx)$',
'/node_modules/(?!@carbon/ibmdotcom-utilities)',
],
moduleFileExtensions: ['js', 'json'],
snapshotSerializers: ['enzyme-to-json/serializer'],
moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},
};