Files
ai-dimension/backend/wdkj-server/tests/setup.js
T
Yuzhiran Dev 24cd9cef53 🎉 feat: initialize 宇之然AI维度 project
- uni-app Vue3 frontend with dark glassmorphism theme
- 5 AI dimensions: Origin / Development / Current / Learning / Trend
- AI Chat system prompt updated from geometry to AI
- 23 AI knowledge articles initialized in DB
- Trend API + cron job for daily news
- Product pricing (Pro ¥19.9, VIP ¥39.9)
- Pinia stores + API utilities
- AGENTS.md documentation
2026-07-10 13:26:04 +08:00

28 lines
533 B
JavaScript
Executable File

/**
* Jest 测试设置
*/
// 增加测试超时时间
jest.setTimeout(30000)
// 全局清理
afterAll(async () => {
// 关闭所有数据库连接
const mongoose = require('mongoose')
if (mongoose.connection.readyState !== 0) {
await mongoose.connection.close()
}
})
// 抑制控制台日志(测试时)
if (process.env.SUPPRESS_LOGS) {
global.console = {
...console,
log: jest.fn(),
debug: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
error: jest.fn()
}
}