mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 12:34:45 -04:00
fix: error in toArrayConfig
If an empty string or undefined is provided the method should not return [], but undefined instead. This way defaults defined in Joi function as expected. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
5db2229771
commit
91d7f1a529
4 changed files with 19 additions and 15 deletions
|
@ -14,7 +14,8 @@ import {
|
|||
describe('config utils', () => {
|
||||
describe('toArrayConfig', () => {
|
||||
it('empty', () => {
|
||||
expect(toArrayConfig('')).toEqual([]);
|
||||
expect(toArrayConfig('')).toEqual(undefined);
|
||||
expect(toArrayConfig(undefined)).toEqual(undefined);
|
||||
});
|
||||
it('one element', () => {
|
||||
expect(toArrayConfig('one')).toEqual(['one']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue