File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ exports.description = Joi.object({
215215 type : Joi . string ( ) . required ( ) ,
216216 flags : Joi . object ( {
217217 cast : Joi . string ( ) ,
218- default : internals . desc . entity . allow ( '' ) ,
218+ default : Joi . any ( ) ,
219219 description : Joi . string ( ) ,
220220 empty : Joi . link ( '/' ) ,
221221 failover : internals . desc . entity ,
Original file line number Diff line number Diff line change @@ -266,6 +266,20 @@ describe('Manifest', () => {
266266 ]
267267 } ) ;
268268 } ) ;
269+
270+ it ( 'describes defaults' , ( ) => {
271+
272+ const schema = Joi . object ( {
273+ foo : Joi . string ( ) . default ( 'bar' )
274+ } )
275+ . default ( { foo : 'bar' } ) ;
276+
277+ expect ( schema . describe ( ) ) . to . equal ( {
278+ type : 'object' ,
279+ flags : { default : { foo : 'bar' } } ,
280+ keys : { foo : { type : 'string' , flags : { default : 'bar' } } }
281+ } ) ;
282+ } ) ;
269283 } ) ;
270284
271285 describe ( 'build()' , ( ) => {
Original file line number Diff line number Diff line change @@ -1465,7 +1465,8 @@ describe('array', () => {
14651465 label : 'value' ,
14661466 value : [ null , 1 , 2 ]
14671467 }
1468- } ]
1468+ } ] ,
1469+ [ { } , false , '"value" must be an array' ]
14691470 ] ) ;
14701471 } ) ;
14711472
@@ -1634,7 +1635,8 @@ describe('array', () => {
16341635 label : 'value' ,
16351636 value : [ 0 , '1' ]
16361637 }
1637- } ]
1638+ } ] ,
1639+ [ { } , false , '"value" must be an array' ]
16381640 ] ) ;
16391641 } ) ;
16401642
You can’t perform that action at this time.
0 commit comments