test(settings): add unit test for the settings validator assertType function for test cases that should throw an error

This commit is contained in:
2026-06-04 14:02:09 +02:00
committed by Gitea
parent 867b3a41f8
commit 948d6d41e8
@@ -39,6 +39,29 @@ describe('assertType', () => {
])('throws no error for the value %s', ([ value ]) => { ])('throws no error for the value %s', ([ value ]) => {
expect(() => assertType(value)).not.throw(Error); expect(() => assertType(value)).not.throw(Error);
}); });
test.for([
[''],
[' '],
[' '],
[' '],
['42'],
['0'],
['-42'],
['-42.0'],
['-0.0'],
['a'],
['ab'],
['SeekraIsGreat!'],
['Seekra is great!'],
[undefined],
[null]
])('throws an error for the value %s', ([ value ]) => {
expect(() => assertType(value)).throw(Error);
});
}); });
describe('assertString', () => { describe('assertString', () => {