-
Notifications
You must be signed in to change notification settings - Fork 16
/
jest.config.js
39 lines (37 loc) · 1.15 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
33
34
35
36
37
38
39
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
const regeneratorRuntime = require('regenerator-runtime');
const _cloneDeep = require('lodash/cloneDeep');
const run = _cloneDeep(regeneratorRuntime);
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.(css|less|scss)$': 'identity-obj-proxy',
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
},
rootDir: '.',
roots: ['<rootDir>/src/'],
testRegex: '.*\\.(test|spec)\\.tsx?$',
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/src/app/',
'<rootDir>/src/appv2/',
],
transform: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/test/fileTransformer.js',
},
transformIgnorePatterns: ['/node_modules/'],
setupFilesAfterEnv: [
require.resolve('./test/global.ts'), // 注册全局
require.resolve('./test/setup.ts'), // 注册一些配置
],
globals: {
window: {},
},
snapshotSerializers: ['enzyme-to-json/serializer'],
// verbose: true,
};