更新测试用例

This commit is contained in:
YHH
2025-10-10 10:58:52 +08:00
parent 9445c735c3
commit 0a0f64510f
6 changed files with 13 additions and 80 deletions

View File

@@ -424,18 +424,18 @@ describe('WorldManager', () => {
});
describe('配置验证', () => {
test('无效的maxWorlds配置应该使用默认值', () => {
WorldManager['_instance'] = null;
test('无效的maxWorlds配置应该按传入值使用', () => {
const invalidConfig: IWorldManagerConfig = {
maxWorlds: -1,
autoCleanup: true,
debug: true
};
expect(() => {
new WorldManager(invalidConfig);
}).not.toThrow();
const manager = new WorldManager(invalidConfig);
expect(manager.getStats().config.maxWorlds).toBe(-1);
manager.destroy();
});
test('配置应该正确应用于新实例', () => {