@@ -105,7 +105,7 @@ describe( 'Mixed Types ', function(){
105
105
} )
106
106
107
107
it ( 'exclusive tests should throw without a name' , function ( ) {
108
- ; ( function ( ) {
108
+ ( function ( ) {
109
109
mixed ( ) . test ( { message : 'invalid' , exclusive : true , test : function ( ) { } } )
110
110
} ) . should . throw ( )
111
111
} )
@@ -133,7 +133,7 @@ describe( 'Mixed Types ', function(){
133
133
message : 'invalid' ,
134
134
exclusive : true ,
135
135
name : 'max' ,
136
- test : function ( v , path , context ) {
136
+ test : function ( ) {
137
137
this . path . should . equal ( 'test' )
138
138
this . parent . should . eql ( { other : 5 , test : 'hi' } )
139
139
this . options . context . should . eql ( { user : 'jason' } )
@@ -149,7 +149,7 @@ describe( 'Mixed Types ', function(){
149
149
var inst = mixed ( ) . test ( {
150
150
message : 'invalid ${path}' ,
151
151
name : 'max' ,
152
- test : function ( v ) {
152
+ test : function ( ) {
153
153
return this . createError ( { path : 'my.path' } )
154
154
}
155
155
} )
@@ -166,7 +166,7 @@ describe( 'Mixed Types ', function(){
166
166
var inst = mixed ( ) . test ( {
167
167
message : 'invalid ${path}' ,
168
168
name : 'max' ,
169
- test : function ( v ) {
169
+ test : function ( ) {
170
170
return this . createError ( { message : '${path} nope!' , path : 'my.path' } )
171
171
}
172
172
} )
@@ -254,13 +254,22 @@ describe( 'Mixed Types ', function(){
254
254
} )
255
255
256
256
it ( 'concat should fail on different types' , function ( ) {
257
- var inst = string ( ) . default ( 'hi' )
257
+ var inst = string ( ) . default ( 'hi' ) ;
258
258
259
- ; ( function ( ) {
259
+ ( function ( ) {
260
260
inst . concat ( object ( ) )
261
261
} ) . should . throw ( TypeError )
262
262
} )
263
263
264
+ it ( 'concat should allow mixed and other type' , function ( ) {
265
+ var inst = mixed ( ) . default ( 'hi' ) ;
266
+
267
+ ( function ( ) {
268
+ inst . concat ( string ( ) ) . _type . should . equal ( 'string' )
269
+
270
+ } ) . should . not . throw ( TypeError )
271
+ } )
272
+
264
273
it ( 'concat should maintain undefined defaults' , function ( ) {
265
274
var inst = string ( ) . default ( 'hi' )
266
275
@@ -285,7 +294,7 @@ describe( 'Mixed Types ', function(){
285
294
//parent
286
295
inst . _validate ( undefined , { } , { parent : { prop : 5 } } ) . should . be . rejected ,
287
296
inst . _validate ( undefined , { } , { parent : { prop : 1 } } ) . should . be . fulfilled ,
288
- inst . _validate ( 'hello' , { } , { parent : { prop : 5 } } ) . should . be . fulfilled ,
297
+ inst . _validate ( 'hello' , { } , { parent : { prop : 5 } } ) . should . be . fulfilled
289
298
] )
290
299
. then ( function ( ) {
291
300
@@ -336,6 +345,3 @@ describe( 'Mixed Types ', function(){
336
345
} )
337
346
338
347
} )
339
-
340
-
341
-
0 commit comments