@@ -35,7 +35,7 @@ function errorMessageSuffix (paramType, type) {
3535 'string' : 'must be a string' ,
3636 'repo-string' : 'must be a string' ,
3737 'number' : 'must be a number' ,
38- 'array' : 'should be an array ' ,
38+ 'array' : 'must be instance of Array ' ,
3939 'object' : 'must be an object' ,
4040 'ObjectId' : 'is not an ObjectId' ,
4141 } ;
@@ -140,9 +140,7 @@ function setupArrayParamsTests (ctx, handler, def, types, param, buildBodyFuncti
140140 body [ param . name ] . push ( typeValue ( ctx , arrayItemType ) ) ;
141141 body [ param . name ] . push ( typeValue ( ctx , arrayItemType ) ) ;
142142 body [ param . name ] . push ( typeValue ( ctx , arrayItemType ) ) ;
143- // e.g. body parameter "env" should be an array of strings
144- var regexp = 'body parameter "' + param . name + '" ' + errorMessageSuffix ( param . type , arrayItemType ) +
145- ' of ' + param . itemType + 's' ;
143+ regexp = '"env" should match' ;
146144 var message = new RegExp ( regexp ) ;
147145 var cb = expects . error ( 400 , message , done ) ;
148146 handler ( body , cb ) ;
@@ -190,4 +188,4 @@ exports.makeTestFromDef = function (def, ctx, handler) {
190188 setupArrayParamsTests ( ctx , handler , def , types , param , buildBodyWithRequiredParams , index ) ;
191189 } ) ;
192190 }
193- } ;
191+ } ;
0 commit comments