@@ -21,12 +21,10 @@ function apiCreator(options) {
21
21
return instance ;
22
22
}
23
23
24
- generateTests ( 'Without Pool: ' , options => apiCreator ( options || { } ) ) ;
24
+ generateTests ( 'Without Pool:' , options => apiCreator ( options || { } ) ) ;
25
25
26
26
// The following two tests are only run against "Without Pool" behavior as they test the exclusive test features. These features are currently not expected to work correctly in the limited process pool. When the limited process pool behavior is finalized this test file will be updated. See: https://github.com/avajs/ava/pull/791#issuecomment-216293302
27
27
test ( 'Without Pool: test file with exclusive tests causes non-exclusive tests in other files to be ignored' , t => {
28
- t . plan ( 4 ) ;
29
-
30
28
const files = [
31
29
path . join ( __dirname , 'fixture/exclusive.js' ) ,
32
30
path . join ( __dirname , 'fixture/exclusive-nonexclusive.js' ) ,
@@ -45,8 +43,6 @@ test('Without Pool: test file with exclusive tests causes non-exclusive tests in
45
43
} ) ;
46
44
47
45
test ( 'Without Pool: test files can be forced to run in exclusive mode' , t => {
48
- t . plan ( 4 ) ;
49
-
50
46
const api = apiCreator ( ) ;
51
47
return api . run (
52
48
[ path . join ( __dirname , 'fixture/es2015.js' ) ] ,
@@ -59,16 +55,14 @@ test('Without Pool: test files can be forced to run in exclusive mode', t => {
59
55
} ) ;
60
56
} ) ;
61
57
62
- generateTests ( 'With Pool: ' , options => {
58
+ generateTests ( 'With Pool:' , options => {
63
59
options = options || { } ;
64
60
options . concurrency = 2 ;
65
61
return apiCreator ( options ) ;
66
62
} ) ;
67
63
68
64
function generateTests ( prefix , apiCreator ) {
69
65
test ( `${ prefix } ES2015 support` , t => {
70
- t . plan ( 1 ) ;
71
-
72
66
const api = apiCreator ( ) ;
73
67
74
68
return api . run ( [ path . join ( __dirname , 'fixture/es2015.js' ) ] )
@@ -78,8 +72,6 @@ function generateTests(prefix, apiCreator) {
78
72
} ) ;
79
73
80
74
test ( `${ prefix } precompile helpers` , t => {
81
- t . plan ( 1 ) ;
82
-
83
75
const api = apiCreator ( {
84
76
precompileHelpers : true ,
85
77
resolveTestsFrom : path . join ( __dirname , 'fixture/precompile-helpers' )
@@ -92,8 +84,6 @@ function generateTests(prefix, apiCreator) {
92
84
} ) ;
93
85
94
86
test ( `${ prefix } generators support` , t => {
95
- t . plan ( 1 ) ;
96
-
97
87
const api = apiCreator ( ) ;
98
88
99
89
return api . run ( [ path . join ( __dirname , 'fixture/generators.js' ) ] )
@@ -103,8 +93,6 @@ function generateTests(prefix, apiCreator) {
103
93
} ) ;
104
94
105
95
test ( `${ prefix } async/await support` , t => {
106
- t . plan ( 1 ) ;
107
-
108
96
const api = apiCreator ( ) ;
109
97
110
98
return api . run ( [ path . join ( __dirname , 'fixture/async-await.js' ) ] )
@@ -222,8 +210,6 @@ function generateTests(prefix, apiCreator) {
222
210
} ) ;
223
211
224
212
test ( `${ prefix } display filename prefixes for failed test stack traces` , t => {
225
- t . plan ( 3 ) ;
226
-
227
213
const files = [
228
214
path . join ( __dirname , 'fixture/es2015.js' ) ,
229
215
path . join ( __dirname , 'fixture/one-pass-one-fail.js' )
@@ -242,8 +228,6 @@ function generateTests(prefix, apiCreator) {
242
228
// This is a seperate test because we can't ensure the order of the errors (to match them), and this is easier than
243
229
// sorting.
244
230
test ( `${ prefix } display filename prefixes for failed test stack traces in subdirs` , t => {
245
- t . plan ( 3 ) ;
246
-
247
231
const files = [
248
232
path . join ( __dirname , 'fixture/es2015.js' ) ,
249
233
path . join ( __dirname , 'fixture/subdir/failing-subdir.js' )
@@ -260,8 +244,6 @@ function generateTests(prefix, apiCreator) {
260
244
} ) ;
261
245
262
246
test ( `${ prefix } fail-fast mode` , t => {
263
- t . plan ( 5 ) ;
264
-
265
247
const api = apiCreator ( {
266
248
failFast : true
267
249
} ) ;
@@ -294,8 +276,6 @@ function generateTests(prefix, apiCreator) {
294
276
} ) ;
295
277
296
278
test ( `${ prefix } serial execution mode` , t => {
297
- t . plan ( 3 ) ;
298
-
299
279
const api = apiCreator ( {
300
280
serial : true
301
281
} ) ;
@@ -309,8 +289,6 @@ function generateTests(prefix, apiCreator) {
309
289
} ) ;
310
290
311
291
test ( `${ prefix } circular references on assertions do not break process.send` , t => {
312
- t . plan ( 1 ) ;
313
-
314
292
const api = apiCreator ( ) ;
315
293
316
294
return api . run ( [ path . join ( __dirname , 'fixture/circular-reference-on-assertion.js' ) ] )
@@ -320,7 +298,6 @@ function generateTests(prefix, apiCreator) {
320
298
} ) ;
321
299
322
300
test ( `${ prefix } run from package.json folder by default` , t => {
323
- t . plan ( 1 ) ;
324
301
const api = apiCreator ( ) ;
325
302
326
303
return api . run ( [ path . join ( __dirname , 'fixture/process-cwd-default.js' ) ] )
@@ -330,8 +307,6 @@ function generateTests(prefix, apiCreator) {
330
307
} ) ;
331
308
332
309
test ( `${ prefix } control worker's process.cwd() with projectDir option` , t => {
333
- t . plan ( 1 ) ;
334
-
335
310
const fullPath = path . join ( __dirname , 'fixture/process-cwd-pkgdir.js' ) ;
336
311
const api = apiCreator ( { projectDir : path . dirname ( fullPath ) } ) ;
337
312
@@ -378,8 +353,6 @@ function generateTests(prefix, apiCreator) {
378
353
} ) ;
379
354
380
355
test ( `${ prefix } errors can occur without messages` , t => {
381
- t . plan ( 2 ) ;
382
-
383
356
const api = apiCreator ( ) ;
384
357
385
358
return api . run ( [ path . join ( __dirname , 'fixture/error-without-message.js' ) ] )
@@ -495,8 +468,6 @@ function generateTests(prefix, apiCreator) {
495
468
} ) ;
496
469
497
470
test ( `${ prefix } absolute paths` , t => {
498
- t . plan ( 1 ) ;
499
-
500
471
const api = apiCreator ( ) ;
501
472
502
473
return api . run ( [ path . resolve ( 'test/fixture/es2015.js' ) ] )
@@ -506,8 +477,6 @@ function generateTests(prefix, apiCreator) {
506
477
} ) ;
507
478
508
479
test ( `${ prefix } symlink to directory containing test files` , t => {
509
- t . plan ( 1 ) ;
510
-
511
480
const api = apiCreator ( ) ;
512
481
513
482
return api . run ( [ path . join ( __dirname , 'fixture/symlink' ) ] )
@@ -517,8 +486,6 @@ function generateTests(prefix, apiCreator) {
517
486
} ) ;
518
487
519
488
test ( `${ prefix } symlink to test file directly` , t => {
520
- t . plan ( 1 ) ;
521
-
522
489
const api = apiCreator ( ) ;
523
490
524
491
return api . run ( [ path . join ( __dirname , 'fixture/symlinkfile.js' ) ] )
@@ -528,8 +495,6 @@ function generateTests(prefix, apiCreator) {
528
495
} ) ;
529
496
530
497
test ( `${ prefix } search directories recursively for files` , t => {
531
- t . plan ( 2 ) ;
532
-
533
498
const api = apiCreator ( ) ;
534
499
535
500
return api . run ( [ path . join ( __dirname , 'fixture/subdir' ) ] )
@@ -540,8 +505,6 @@ function generateTests(prefix, apiCreator) {
540
505
} ) ;
541
506
542
507
test ( `${ prefix } titles of both passing and failing tests and AssertionErrors are returned` , t => {
543
- t . plan ( 3 ) ;
544
-
545
508
const api = apiCreator ( ) ;
546
509
547
510
return api . run ( [ path . join ( __dirname , 'fixture/one-pass-one-fail.js' ) ] )
@@ -674,8 +637,6 @@ function generateTests(prefix, apiCreator) {
674
637
} ) ;
675
638
676
639
test ( `${ prefix } Node.js-style --require CLI argument` , t => {
677
- t . plan ( 1 ) ;
678
-
679
640
const requirePath = './' + path . relative ( '.' , path . join ( __dirname , 'fixture/install-global.js' ) ) . replace ( / \\ / g, '/' ) ;
680
641
681
642
const api = apiCreator ( {
@@ -689,16 +650,14 @@ function generateTests(prefix, apiCreator) {
689
650
} ) ;
690
651
691
652
test ( `${ prefix } Node.js-style --require CLI argument module not found` , t => {
692
- t . plan ( 1 ) ;
693
-
694
653
t . throws ( ( ) => {
695
654
/* eslint no-new: 0 */
696
655
apiCreator ( { require : [ 'foo-bar' ] } ) ;
697
656
} , / ^ C o u l d n o t r e s o l v e r e q u i r e d m o d u l e ' f o o - b a r ' $ / ) ;
657
+ t . end ( ) ;
698
658
} ) ;
699
659
700
660
test ( `${ prefix } caching is enabled by default` , t => {
701
- t . plan ( 3 ) ;
702
661
rimraf . sync ( path . join ( __dirname , 'fixture/caching/node_modules' ) ) ;
703
662
704
663
const api = apiCreator ( {
@@ -711,7 +670,6 @@ function generateTests(prefix, apiCreator) {
711
670
t . is ( files . length , 2 ) ;
712
671
t . is ( files . filter ( endsWithJs ) . length , 1 ) ;
713
672
t . is ( files . filter ( endsWithMap ) . length , 1 ) ;
714
- t . end ( ) ;
715
673
} ) ;
716
674
717
675
function endsWithJs ( filename ) {
@@ -724,7 +682,6 @@ function generateTests(prefix, apiCreator) {
724
682
} ) ;
725
683
726
684
test ( `${ prefix } caching can be disabled` , t => {
727
- t . plan ( 1 ) ;
728
685
rimraf . sync ( path . join ( __dirname , 'fixture/caching/node_modules' ) ) ;
729
686
730
687
const api = apiCreator ( {
@@ -735,13 +692,10 @@ function generateTests(prefix, apiCreator) {
735
692
return api . run ( [ path . join ( __dirname , 'fixture/caching/test.js' ) ] )
736
693
. then ( ( ) => {
737
694
t . false ( fs . existsSync ( path . join ( __dirname , 'fixture/caching/node_modules/.cache/ava' ) ) ) ;
738
- t . end ( ) ;
739
695
} ) ;
740
696
} ) ;
741
697
742
698
test ( `${ prefix } test file with only skipped tests does not create a failure` , t => {
743
- t . plan ( 2 ) ;
744
-
745
699
const api = apiCreator ( ) ;
746
700
747
701
return api . run ( [ path . join ( __dirname , 'fixture/skip-only.js' ) ] )
@@ -752,8 +706,6 @@ function generateTests(prefix, apiCreator) {
752
706
} ) ;
753
707
754
708
test ( `${ prefix } resets state before running` , t => {
755
- t . plan ( 2 ) ;
756
-
757
709
const api = apiCreator ( ) ;
758
710
759
711
return api . run ( [ path . resolve ( 'test/fixture/es2015.js' ) ] ) . then ( result => {
@@ -1044,8 +996,6 @@ function generateTests(prefix, apiCreator) {
1044
996
1045
997
function generatePassDebugTests ( execArgv , expectedInspectIndex ) {
1046
998
test ( `pass ${ execArgv . join ( ' ' ) } to fork` , t => {
1047
- t . plan ( expectedInspectIndex === - 1 ? 3 : 2 ) ;
1048
-
1049
999
const api = apiCreator ( { testOnlyExecArgv : execArgv } ) ;
1050
1000
return api . _computeForkExecArgs ( [ 'foo.js' ] )
1051
1001
. then ( result => {
@@ -1062,8 +1012,6 @@ function generatePassDebugTests(execArgv, expectedInspectIndex) {
1062
1012
1063
1013
function generatePassDebugIntegrationTests ( execArgv ) {
1064
1014
test ( `pass ${ execArgv . join ( ' ' ) } to fork` , t => {
1065
- t . plan ( 1 ) ;
1066
-
1067
1015
const api = apiCreator ( { testOnlyExecArgv : execArgv } ) ;
1068
1016
return api . run ( [ path . join ( __dirname , 'fixture/debug-arg.js' ) ] )
1069
1017
. then ( result => {
0 commit comments