27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
|
|
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
||
|
|
module.exports = {
|
||
|
|
preset: 'ts-jest',
|
||
|
|
testEnvironment: 'node',
|
||
|
|
roots: ['<rootDir>/tests'],
|
||
|
|
testMatch: ['**/*.performance.test.ts'],
|
||
|
|
collectCoverage: false,
|
||
|
|
verbose: true,
|
||
|
|
transform: {
|
||
|
|
'^.+\\.tsx?$': ['ts-jest', {
|
||
|
|
tsconfig: 'tsconfig.test.json',
|
||
|
|
}],
|
||
|
|
},
|
||
|
|
moduleNameMapper: {
|
||
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
||
|
|
},
|
||
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
||
|
|
// 性能测试需要更长的超时时间
|
||
|
|
testTimeout: 60000,
|
||
|
|
clearMocks: true,
|
||
|
|
restoreMocks: true,
|
||
|
|
modulePathIgnorePatterns: [
|
||
|
|
'<rootDir>/bin/',
|
||
|
|
'<rootDir>/dist/',
|
||
|
|
'<rootDir>/node_modules/'
|
||
|
|
]
|
||
|
|
};
|