forked from datawhale/whale-town-end
test:添加 Jest 测试框架配置
- 配置 TypeScript 支持和模块解析 - 设置测试文件匹配规则和覆盖率收集 - 支持日志系统的单元测试运行
This commit is contained in:
16
jest.config.js
Normal file
16
jest.config.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
module.exports = {
|
||||||
|
moduleFileExtensions: ['js', 'json', 'ts'],
|
||||||
|
rootDir: 'src',
|
||||||
|
testRegex: '.*\\.spec\\.ts$',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(t|j)s$': 'ts-jest',
|
||||||
|
},
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'**/*.(t|j)s',
|
||||||
|
],
|
||||||
|
coverageDirectory: '../coverage',
|
||||||
|
testEnvironment: 'node',
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^src/(.*)$': '<rootDir>/$1',
|
||||||
|
},
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user