@@ -414,17 +414,47 @@ test('bails when config contains `"tap": true` and `"watch": true`', t => {
414
414
} ) ;
415
415
416
416
[ '--concurrency' , '-c' ] . forEach ( concurrencyFlag => {
417
- test ( `bails when ${ concurrencyFlag } provided without value` , t => {
417
+ test ( `bails when ${ concurrencyFlag } is provided without value` , t => {
418
418
execCli ( [ 'test.js' , concurrencyFlag ] , { dirname : 'fixture/concurrency' } , ( err , stdout , stderr ) => {
419
419
t . is ( err . code , 1 ) ;
420
- t . match ( stderr , 'The --concurrency and -c flags must be provided the maximum number of test files to run at once .' ) ;
420
+ t . match ( stderr , 'The --concurrency and -c flags must be provided.' ) ;
421
421
t . end ( ) ;
422
422
} ) ;
423
423
} ) ;
424
424
} ) ;
425
425
426
426
[ '--concurrency' , '-c' ] . forEach ( concurrencyFlag => {
427
- test ( `works when ${ concurrencyFlag } provided with value` , t => {
427
+ test ( `bails when ${ concurrencyFlag } is provided with an input that is a string` , t => {
428
+ execCli ( [ `${ concurrencyFlag } =foo` , 'test.js' , concurrencyFlag ] , { dirname : 'fixture/concurrency' } , ( err , stdout , stderr ) => {
429
+ t . is ( err . code , 1 ) ;
430
+ t . match ( stderr , 'The --concurrency and -c flags must be a nonnegative integer.' ) ;
431
+ t . end ( ) ;
432
+ } ) ;
433
+ } ) ;
434
+ } ) ;
435
+
436
+ [ '--concurrency' , '-c' ] . forEach ( concurrencyFlag => {
437
+ test ( `bails when ${ concurrencyFlag } is provided with an input that is a float` , t => {
438
+ execCli ( [ `${ concurrencyFlag } =4.7` , 'test.js' , concurrencyFlag ] , { dirname : 'fixture/concurrency' } , ( err , stdout , stderr ) => {
439
+ t . is ( err . code , 1 ) ;
440
+ t . match ( stderr , 'The --concurrency and -c flags must be a nonnegative integer.' ) ;
441
+ t . end ( ) ;
442
+ } ) ;
443
+ } ) ;
444
+ } ) ;
445
+
446
+ [ '--concurrency' , '-c' ] . forEach ( concurrencyFlag => {
447
+ test ( `bails when ${ concurrencyFlag } is provided with an input that is negative` , t => {
448
+ execCli ( [ `${ concurrencyFlag } =-1` , 'test.js' , concurrencyFlag ] , { dirname : 'fixture/concurrency' } , ( err , stdout , stderr ) => {
449
+ t . is ( err . code , 1 ) ;
450
+ t . match ( stderr , 'The --concurrency and -c flags must be a nonnegative integer.' ) ;
451
+ t . end ( ) ;
452
+ } ) ;
453
+ } ) ;
454
+ } ) ;
455
+
456
+ [ '--concurrency' , '-c' ] . forEach ( concurrencyFlag => {
457
+ test ( `works when ${ concurrencyFlag } is provided with a value` , t => {
428
458
execCli ( [ `${ concurrencyFlag } =1` , 'test.js' ] , { dirname : 'fixture/concurrency' } , err => {
429
459
t . ifError ( err ) ;
430
460
t . end ( ) ;
0 commit comments