-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
58 lines (54 loc) · 1.77 KB
/
jest.config.ts
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
51
52
53
54
55
56
57
58
/* eslint-disable filenames/match-exported */
/**
* Copyright (c) ACT, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const config: JestConfigWithTsJest = {
collectCoverage: true,
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/icons/**',
'!**/*stories*.tsx',
],
coveragePathIgnorePatterns: [
'src/styles/index.ts',
'src/constants/index.ts',
'src/components/index.ts',
'src/index.ts',
'src/styles/index.ts',
'internal.tsx',
],
coverageReporters: ['text', 'html'],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
'd3-array': '<rootDir>/node_modules/d3-array/dist/d3-array.min.js',
'd3-color': '<rootDir>/node_modules/d3-color/dist/d3-color.min.js',
'd3-format': '<rootDir>/node_modules/d3-format/dist/d3-format.min.js',
'd3-interpolate':
'<rootDir>/node_modules/d3-interpolate/dist/d3-interpolate.min.js',
'd3-path': '<rootDir>/node_modules/d3-path/dist/d3-path.min.js',
'd3-scale': '<rootDir>/node_modules/d3-scale/dist/d3-scale.min.js',
'd3-shape': '<rootDir>/node_modules/d3-shape/dist/d3-shape.min.js',
'd3-time': '<rootDir>/node_modules/d3-time/dist/d3-time.min.js',
},
preset: 'ts-jest',
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['./jest.setup.ts'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
babelConfig: 'babel.test.js',
diagnostics: false,
tsconfig: './tsconfig.json',
},
],
},
};
export default config;