From ae58596473c9346491fb1608ab7ab77555486821 Mon Sep 17 00:00:00 2001 From: moyin <244344649@qq.com> Date: Sat, 13 Dec 2025 16:20:03 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E6=9B=B4=E6=96=B0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BE=9D=E8=B5=96=E5=92=8C=20TypeScript=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加测试相关依赖:Jest、@nestjs/testing、ts-jest - 更新 TypeScript 配置支持 Jest 类型定义 - 完善开发环境工具链配置 --- package.json | 45 +++++++++++++++++++++++++++++++-------------- tsconfig.json | 3 ++- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 1dd6731..eeb6e1b 100644 --- a/package.json +++ b/package.json @@ -7,25 +7,42 @@ "dev": "nest start --watch", "build": "nest build", "start": "node dist/main.js", - "start:prod": "node dist/main.js" + "start:prod": "node dist/main.js", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage" }, - "keywords": ["game", "pixel", "2d", "server", "nestjs"], + "keywords": [ + "game", + "pixel", + "2d", + "server", + "nestjs" + ], "author": "", "license": "MIT", "dependencies": { - "@nestjs/common": "^10.0.0", - "@nestjs/core": "^10.0.0", - "@nestjs/platform-express": "^10.0.0", - "@nestjs/websockets": "^10.0.0", - "@nestjs/platform-socket.io": "^10.0.0", - "reflect-metadata": "^0.1.13", - "rxjs": "^7.8.1" + "@nestjs/common": "^10.4.20", + "@nestjs/config": "^4.0.2", + "@nestjs/core": "^10.4.20", + "@nestjs/platform-express": "^10.4.20", + "@nestjs/platform-socket.io": "^10.4.20", + "@nestjs/websockets": "^10.4.20", + "nestjs-pino": "^4.5.0", + "pino": "^10.1.0", + "reflect-metadata": "^0.1.14", + "rxjs": "^7.8.2" }, "devDependencies": { - "@nestjs/cli": "^10.0.0", - "@nestjs/schematics": "^10.0.0", - "@types/node": "^20.0.0", - "ts-node": "^10.9.0", - "typescript": "^5.3.0" + "@nestjs/cli": "^10.4.9", + "@nestjs/schematics": "^10.2.3", + "@nestjs/testing": "^10.4.20", + "@types/jest": "^29.5.14", + "@types/node": "^20.19.26", + "jest": "^29.7.0", + "pino-pretty": "^13.1.3", + "ts-jest": "^29.2.5", + "ts-node": "^10.9.2", + "typescript": "^5.9.3" } } diff --git a/tsconfig.json b/tsconfig.json index 83112bf..9b68a07 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "outDir": "./dist", "baseUrl": "./", "incremental": true, - "strictNullChecks": false + "strictNullChecks": false, + "types": ["jest", "node"] }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"]