-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
jest.config.js
32 lines (30 loc) · 1.04 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
/**
* Copyright IBM Corp. 2018, 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.
*/
'use strict';
module.exports = {
preset: 'jest-config-carbon',
collectCoverageFrom: [
'packages/**/src/**/*.js',
'packages/**/src/**/*.tsx',
'!packages/{cli,components}/**',
'!packages/**/{examples,stories}/**',
'!**/*-story.js',
'!**/*.stories.js',
'!**/*-test.e2e.js',
],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!lodash-es)'],
moduleNameMapper: {
// This is a temporary workaround from moving to Jest v28. In this update,
// certain dependencies are only providing ESM through exports and so we use
// `require.resolve` to force CommonJS resolution
//
// @see https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports
// @see https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149
nanoid: require.resolve('nanoid'),
},
reporters: ['default', 'jest-junit'],
};