-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjest.config.js
30 lines (28 loc) · 995 Bytes
/
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
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
const transformIgnorePatterns = [
'/dist/',
// Ignore modules without es dir.
// Update: @babel/runtime should also be transformed
// 'node_modules/(?!.*(@babel|lodash-es))',
'node_modules/(?!@ant-design/icons-vue|@ant-design/icons-svg|lodash-es)/',
];
module.exports = {
verbose: true,
roots: ['<rootDir>/tests'],
testMatch: ['**/?(*.)+(spec|test|unit.test).+(ts|tsx|js)'],
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
"^.+\\.svg$": "jest-transform-stub"
},
moduleFileExtensions: ['vue', 'js', 'json', 'ts'],
setupFiles: ['<rootDir>/tests/setup.ts'],
globalSetup: '<rootDir>/tests/globalSetup.ts',
globalTeardown: '<rootDir>/tests/globalTeardown.ts',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/src/',
}),
transformIgnorePatterns,
};