浏览代码

✅ test(scripts): add comprehensive test scripts

- 添加基础测试命令: test, test:coverage, test:api, test:components
- 添加E2E测试命令: test:e2e, test:e2e:ui, test:e2e:debug, test:e2e:chromium
- 添加测试覆盖率命令: test:api:coverage, test:components:coverage

🔧 chore(scripts): add database and utility scripts

- 添加数据库操作命令: db:migrate, db:seed, db:reset
- 添加数据库备份恢复命令: db:backup, db:restore, db:backup:list, db:backup:latest, db:backup:cleanup
- 添加代码质量命令: lint, lint:fix, typecheck
- 添加测试分析命令: test:analyze
yourname 2 月之前
父节点
当前提交
c284fc5d01
共有 1 个文件被更改,包括 24 次插入1 次删除
  1. 24 1
      package.json

+ 24 - 1
package.json

@@ -10,7 +10,30 @@
     "build": "npm run build:client && npm run build:server",
     "build:client": "vite build --outDir dist/client --manifest",
     "build:server": "vite build --ssr src/server/index.tsx --outDir dist/server",
-    "start": "PORT=8080 cross-env NODE_ENV=production node server"
+    "start": "PORT=8080 cross-env NODE_ENV=production node server",
+    "test": "npm run test:api",
+    "test:coverage": "npm run test:api:coverage && npm run test:components:coverage",
+    "test:api": "vitest",
+    "test:components": "vitest --config=vitest.config.components.ts",
+    "test:integration": "npm run test:components",
+    "test:api:coverage": "vitest --coverage",
+    "test:components:coverage": "vitest --coverage --config=vitest.config.components.ts",
+    "test:e2e": "playwright test --config=tests/e2e/playwright.config.ts",
+    "test:e2e:ui": "playwright test --config=tests/e2e/playwright.config.ts --ui",
+    "test:e2e:debug": "playwright test --config=tests/e2e/playwright.config.ts --debug",
+    "test:e2e:chromium": "playwright test --config=tests/e2e/playwright.config.ts --project=chromium",
+    "db:migrate": "tsx scripts/migrate.ts",
+    "db:seed": "tsx scripts/seed.ts",
+    "db:reset": "tsx scripts/reset-db.ts",
+    "db:backup": "tsx src/server/utils/backup.ts backup",
+    "db:restore": "tsx src/server/utils/restore.ts restore",
+    "db:backup:list": "tsx src/server/utils/restore.ts list",
+    "db:backup:latest": "tsx src/server/utils/restore.ts latest",
+    "db:backup:cleanup": "tsx src/server/utils/backup.ts cleanup",
+    "test:analyze": "node scripts/analyze-test-results.js",
+    "lint": "eslint . --ext .ts,.tsx",
+    "lint:fix": "eslint . --ext .ts,.tsx --fix",
+    "typecheck": "tsc --noEmit --project ."
   },
   "dependencies": {
     "@ant-design/icons": "^6.0.0",