/**
 * D8D Shared Test Utilities
 *
 * 统一的测试工具包，为服务器和客户端测试提供共享工具函数
 */

// 通用测试工具
export {
  createTestServer,
  createMockUser,
  wait
} from './test-utils.js';
export * from './setup.js';

// 服务器测试工具
export {
  createMockDataSource,
  createMockRepository,
  createMockAuthContext
} from './server/index.js';

// 客户端测试配置
export type { ClientTestConfig } from './client/index.js';
export { defaultClientTestConfig } from './client/index.js';

// 服务器测试配置
export type { ServerTestConfig } from './server/index.js';
export { defaultServerTestConfig } from './server/index.js';

/**
 * 测试工具包配置接口
 */
export interface TestUtilsConfig {
  /** 测试环境配置 */
  environment: 'test' | 'development' | 'production';
  /** 是否启用详细日志 */
  verbose?: boolean;
  /** 测试数据库配置 */
  database?: {
    host: string;
    port: number;
    name: string;
  };
}

/**
 * 测试工具包基础配置
 */
export const defaultTestConfig: TestUtilsConfig = {
  environment: 'test',
  verbose: false,
  database: {
    host: 'localhost',
    port: 5432,
    name: 'test_db'
  }
};