forked from xiangwang25/whale-town-end-v2
feat: integrate invitation access, world NPCs, and deployment
This commit is contained in:
27
test-setup.js
Normal file
27
test-setup.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Jest测试环境设置
|
||||
*
|
||||
* 功能描述:
|
||||
* - 加载.env文件中的环境变量
|
||||
* - 为测试环境提供必要的配置
|
||||
*
|
||||
* @author moyin
|
||||
* @version 1.0.0
|
||||
* @since 2026-01-12
|
||||
*/
|
||||
|
||||
const dotenv = require('dotenv');
|
||||
const path = require('path');
|
||||
|
||||
// 加载.env文件
|
||||
dotenv.config({ path: path.resolve(__dirname, '.env') });
|
||||
|
||||
// 只在需要时输出调试信息
|
||||
if (process.env.DEBUG_TEST_CONFIG === 'true') {
|
||||
console.log('🔧 测试环境配置加载:');
|
||||
console.log(` DB_HOST: ${process.env.DB_HOST ? '已配置' : '未配置'}`);
|
||||
console.log(` DB_PORT: ${process.env.DB_PORT ? '已配置' : '未配置'}`);
|
||||
console.log(` DB_USERNAME: ${process.env.DB_USERNAME ? '已配置' : '未配置'}`);
|
||||
console.log(` DB_PASSWORD: ${process.env.DB_PASSWORD ? '已配置' : '未配置'}`);
|
||||
console.log(` DB_NAME: ${process.env.DB_NAME ? '已配置' : '未配置'}`);
|
||||
}
|
||||
Reference in New Issue
Block a user