File tree 4 files changed +16
-48
lines changed 4 files changed +16
-48
lines changed Original file line number Diff line number Diff line change @@ -312,18 +312,10 @@ describe('bodyParser.json()', function(){
312
312
} )
313
313
} )
314
314
315
- describe ( 'with verify option' , function ( ) {
316
- it ( 'should assert value if function' , function ( ) {
317
- var err ;
318
-
319
- try {
320
- var server = createServer ( { verify : 'lol' } )
321
- } catch ( e ) {
322
- err = e ;
323
- }
324
-
325
- assert . ok ( err ) ;
326
- assert . equal ( err . name , 'TypeError' ) ;
315
+ describe ( 'with verify option' , function ( ) {
316
+ it ( 'should assert value if function' , function ( ) {
317
+ assert . throws ( createServer . bind ( null , { verify : 'lol' } ) ,
318
+ / T y p e E r r o r : o p t i o n v e r i f y m u s t b e f u n c t i o n / )
327
319
} )
328
320
329
321
it ( 'should error from verify' , function ( done ) {
Original file line number Diff line number Diff line change @@ -228,18 +228,10 @@ describe('bodyParser.raw()', function(){
228
228
} )
229
229
} )
230
230
231
- describe ( 'with verify option' , function ( ) {
232
- it ( 'should assert value is function' , function ( ) {
233
- var err ;
234
-
235
- try {
236
- var server = createServer ( { verify : 'lol' } )
237
- } catch ( e ) {
238
- err = e ;
239
- }
240
-
241
- assert . ok ( err ) ;
242
- assert . equal ( err . name , 'TypeError' ) ;
231
+ describe ( 'with verify option' , function ( ) {
232
+ it ( 'should assert value is function' , function ( ) {
233
+ assert . throws ( createServer . bind ( null , { verify : 'lol' } ) ,
234
+ / T y p e E r r o r : o p t i o n v e r i f y m u s t b e f u n c t i o n / )
243
235
} )
244
236
245
237
it ( 'should error from verify' , function ( done ) {
Original file line number Diff line number Diff line change @@ -256,18 +256,10 @@ describe('bodyParser.text()', function(){
256
256
} )
257
257
} )
258
258
259
- describe ( 'with verify option' , function ( ) {
260
- it ( 'should assert value is function' , function ( ) {
261
- var err ;
262
-
263
- try {
264
- var server = createServer ( { verify : 'lol' } )
265
- } catch ( e ) {
266
- err = e ;
267
- }
268
-
269
- assert . ok ( err ) ;
270
- assert . equal ( err . name , 'TypeError' ) ;
259
+ describe ( 'with verify option' , function ( ) {
260
+ it ( 'should assert value is function' , function ( ) {
261
+ assert . throws ( createServer . bind ( null , { verify : 'lol' } ) ,
262
+ / T y p e E r r o r : o p t i o n v e r i f y m u s t b e f u n c t i o n / )
271
263
} )
272
264
273
265
it ( 'should error from verify' , function ( done ) {
Original file line number Diff line number Diff line change @@ -480,18 +480,10 @@ describe('bodyParser.urlencoded()', function(){
480
480
} )
481
481
} )
482
482
483
- describe ( 'with verify option' , function ( ) {
484
- it ( 'should assert value if function' , function ( ) {
485
- var err ;
486
-
487
- try {
488
- var server = createServer ( { verify : 'lol' } )
489
- } catch ( e ) {
490
- err = e ;
491
- }
492
-
493
- assert . ok ( err ) ;
494
- assert . equal ( err . name , 'TypeError' ) ;
483
+ describe ( 'with verify option' , function ( ) {
484
+ it ( 'should assert value if function' , function ( ) {
485
+ assert . throws ( createServer . bind ( null , { verify : 'lol' } ) ,
486
+ / T y p e E r r o r : o p t i o n v e r i f y m u s t b e f u n c t i o n / )
495
487
} )
496
488
497
489
it ( 'should error from verify' , function ( done ) {
You can’t perform that action at this time.
0 commit comments