()
| 28 | * @returns 测试上下文对象 |
| 29 | */ |
| 30 | export async function setupMessageTest(): Promise<MessageTestContext> { |
| 31 | const config = ConfigLoader.load(path.resolve(__dirname, '../config/test.config.json')); |
| 32 | const testTimeout = config.timeout || 30000; |
| 33 | const accountManager = new AccountManager(config); |
| 34 | const twoAccountTest = new TwoAccountTest(accountManager); |
| 35 | |
| 36 | // 启动事件监听器 |
| 37 | await twoAccountTest.startAllListeners(); |
| 38 | |
| 39 | // 从配置中获取用户 ID |
| 40 | const primaryUserId = config.accounts.primary.user_id; |
| 41 | const secondaryUserId = config.accounts.secondary.user_id; |
| 42 | const testGroupId = config.test_group_id; |
| 43 | |
| 44 | return { |
| 45 | accountManager, |
| 46 | twoAccountTest, |
| 47 | testTimeout, |
| 48 | testGroupId, |
| 49 | primaryUserId, |
| 50 | secondaryUserId, |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * 清理消息测试环境 |
no test coverage detected