Add settings validator unit test #113

Merged
jakob.scheid merged 20 commits from testing/settings-validator into main 2026-06-04 17:48:09 +02:00
Showing only changes of commit 5f07e66915 - Show all commits
@@ -66,12 +66,12 @@ export const validateEntry = function validateEntry (entry, path) {
if (entry.type === 'string' && typeof entry.default !== 'string') { if (entry.type === 'string' && typeof entry.default !== 'string') {
throw new Error(`[settings] "${path}.default" must be a string`); throw new Error(`[settings] "${path}.default" must be a string`);
} }
if (entry.type === 'selection') { }
validateSelectionOptions(entry.options, path); if (entry.type === 'selection') {
if (typeof entry.allowMultiple !== 'boolean' && entry.allowMultiple) { validateSelectionOptions(entry.options, path);
throw new Error(`[settings] "${path}.allowMultiple" must be a boolean`); if (typeof entry.allowMultiple !== 'boolean' && entry.allowMultiple) {
} throw new Error(`[settings] "${path}.allowMultiple" must be a boolean`);
} }
} }
} }