ci(test): 为单元测试注入 DATABASE_URL 与 JWT_SECRET,避免 Prisma 在 test 环境报错

This commit is contained in:
Paper Burner Bot
2025-11-01 01:21:46 +08:00
parent bba5dced74
commit a1dd02310c
+7 -5
View File
@@ -133,8 +133,10 @@ jobs:
exit 1
fi
- name: Run unit tests
working-directory: ./server
env:
NODE_ENV: test
run: npm test
- name: Run unit tests
working-directory: ./server
env:
NODE_ENV: test
DATABASE_URL: postgresql://test:test@localhost:5432/test
JWT_SECRET: test-secret-key-for-ci
run: npm test