MCPcopy
hub / github.com/LLOneBot/LuckyLilliaBot / setupMessageTest

Function setupMessageTest

test/onebot11-api-test/tests/setup.ts:30–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 * @returns 测试上下文对象
29 */
30export 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 * 清理消息测试环境

Calls 2

startAllListenersMethod · 0.95
loadMethod · 0.80

Tested by

no test coverage detected