-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathjest.config.js
More file actions
41 lines (40 loc) · 1.24 KB
/
jest.config.js
File metadata and controls
41 lines (40 loc) · 1.24 KB
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
/**
* Copyright IBM Corp. 2018, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
export default {
preset: 'jest-config-carbon',
testEnvironment: 'jsdom',
collectCoverageFrom: [
'packages/**/src/**/*.js',
'packages/**/src/**/*.tsx',
'!packages/{cli,components}/**',
'!packages/**/{examples,stories}/**',
'!**/*-story.js',
'!**/*.stories.js',
'!**/*-test.e2e.js',
],
coveragePathIgnorePatterns: [
'packages/web-components/*',
// TODO: remove scss-generator once issue is resolved
// https://github.com/carbon-design-system/carbon/issues/20115
'packages/scss-generator/*',
],
testPathIgnorePatterns: [
'packages/web-components/*',
// TODO: remove scss-generator once issue is resolved
// https://github.com/carbon-design-system/carbon/issues/20115
'packages/scss-generator/*',
],
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!lodash-es|nanoid|chalk)',
],
moduleNameMapper: {
// Jest uses identity-obj-proxy to mock CSS/SCSS imports.
'\\.(css|scss)$': 'identity-obj-proxy',
},
reporters: ['default', 'jest-junit'],
extensionsToTreatAsEsm: ['.jsx', '.ts', '.tsx'],
};