forked from Tencent/tdesign-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
26 lines (24 loc) · 817 Bytes
/
jest.config.js
File metadata and controls
26 lines (24 loc) · 817 Bytes
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
const path = require('path');
process.env.TZ = 'Asia/Shanghai';
module.exports = {
rootDir: path.resolve(__dirname, './'),
setupFilesAfterEnv: ['./test/setup-framework.js'],
preset: 'ts-jest',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': 'babel-jest',
'^.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
},
transformIgnorePatterns: ['node_modules/?!(popper.js)'],
verbose: false,
moduleNameMapper: {
// 测试工具便捷引入
'^@test/(.*)': '<rootDir>/test/$1',
// 组件 alias
'^tdesign-react(.*)': '<rootDir>/src$1',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverage: true,
coverageReporters: ['json', 'html'],
testMatch: ['<rootDir>/src/**/__tests__/**/*.test.{ts,tsx}'],
};