forked from cloudscape-design/components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.unit.config.js
38 lines (37 loc) · 1.21 KB
/
jest.unit.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
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const path = require('path');
const merge = require('lodash/merge');
const tsPreset = require('ts-jest/jest-preset');
const cloudscapePreset = require('@cloudscape-design/jest-preset/jest-preset');
module.exports = merge({}, tsPreset, cloudscapePreset, {
verbose: true,
testEnvironment: 'jsdom',
reporters: ['default', 'github-actions'],
collectCoverage: true,
coveragePathIgnorePatterns: [
'__tests__',
'__integ__',
'/design-tokens/',
'/node_modules/',
'styles.css.js$',
'styles.scoped.css$',
'styles.selectors.js$',
'icons.js$',
'environment.js$',
'<rootDir>/pages',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.unit.json',
},
},
transform: {
'(?!node_modules).*/lib/(components|design-tokens)/.*\\.js$': require.resolve(
'@cloudscape-design/jest-preset/js-transformer'
),
'(?!node_modules).*/lib/components/.*\\.css$': require.resolve('@cloudscape-design/jest-preset/css-transformer'),
},
setupFilesAfterEnv: [path.join(__dirname, 'build-tools', 'jest', 'setup.js')],
testRegex: '(/__tests__/.*(\\.|/)test)\\.[jt]sx?$',
});