update at 2026-01-23 23:20:39

This commit is contained in:
douboer@gmail.com
2026-01-23 23:20:39 +08:00
parent dc45937623
commit d6312fcd16
24 changed files with 982 additions and 143 deletions

View File

@@ -22,13 +22,14 @@ describe('configParser', () => {
expect(config.name).toBe('demo');
expect(config.layers.length).toBeGreaterThan(0);
expect(config.theme.colorPalettes['木']).toBe('#43A047');
expect(config.themeRef).toBe('五行配色主题');
expect(config.theme).toBeUndefined();
expect(config.layers.some((layer) => layer.type === 'centerIcon')).toBe(true);
expect(config.layers.some((layer) => layer.type === 'degreeRing')).toBe(true);
});
it('缺少必填字段时应抛错', () => {
const raw = '{ "background": "#000", "theme": { "colorPalettes": {} }, "layers": [] }';
const raw = '{ "background": "#000", "layers": [] }';
expect(() => parseConfig(raw)).toThrow('name 为必填字符串');
});
});