From 569a69c00e4c55098092d94accad253df08e1afd Mon Sep 17 00:00:00 2001 From: moyin <244344649@qq.com> Date: Thu, 8 Jan 2026 23:04:17 +0800 Subject: [PATCH] =?UTF-8?q?config=EF=BC=9A=E6=9B=B4=E6=96=B0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化Jest测试配置 - 更新package.json依赖和脚本 --- jest.config.js | 6 +++--- package.json | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/jest.config.js b/jest.config.js index 3362150..26bc021 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ module.exports = { moduleFileExtensions: ['js', 'json', 'ts'], - rootDir: 'src', - testRegex: '.*\\.spec\\.ts$', + roots: ['/src', '/test'], + testRegex: '.*\\.(spec|e2e-spec|integration-spec|perf-spec)\\.ts$', transform: { '^.+\\.(t|j)s$': 'ts-jest', }, @@ -11,6 +11,6 @@ module.exports = { coverageDirectory: '../coverage', testEnvironment: 'node', moduleNameMapper: { - '^src/(.*)$': '/$1', + '^src/(.*)$': '/src/$1', }, }; \ No newline at end of file diff --git a/package.json b/package.json index f6fb76b..187c22b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pixel-game-server", - "version": "1.1.1", - "description": "A 2D pixel art game server built with NestJS - 支持验证码登录功能和邮箱冲突检测", + "version": "1.2.0", + "description": "A 2D pixel art game server built with NestJS - 完整的游戏服务器,包含用户认证、位置广播、聊天系统、管理员后台等功能模块", "main": "dist/main.js", "scripts": { "dev": "nest start --watch", @@ -59,6 +59,7 @@ "zulip-js": "^2.1.0" }, "devDependencies": { + "@faker-js/faker": "^10.2.0", "@nestjs/cli": "^10.4.9", "@nestjs/schematics": "^10.2.3", "@nestjs/testing": "^10.4.20",