@@ -24,20 +24,21 @@ tap.test('failures', function (tt) {
2424 tt . plan ( 1 ) ;
2525
2626 var test = tape . createHarness ( ) ;
27+ var count = 0 ;
2728 test . createStream ( ) . pipe ( concat ( function ( body ) {
2829 tt . same ( stripFullStack ( body . toString ( 'utf8' ) ) , [
2930 'TAP version 13' ,
3031 '# non functions' ,
31- 'ok 1 should throw' ,
32- 'ok 2 should throw' ,
33- 'ok 3 should throw' ,
34- 'ok 4 should throw' ,
35- 'ok 5 should throw' ,
36- 'ok 6 should throw' ,
37- 'ok 7 should throw' ,
38- 'ok 8 should throw' ,
32+ 'ok ' + ++ count + ' should throw',
33+ 'ok ' + ++ count + ' should throw',
34+ 'ok ' + ++ count + ' should throw',
35+ 'ok ' + ++ count + ' should throw',
36+ 'ok ' + ++ count + ' should throw',
37+ 'ok ' + ++ count + ' should throw',
38+ 'ok ' + ++ count + ' should throw',
39+ 'ok ' + ++ count + ' should throw',
3940 '# function' ,
40- 'not ok 9 should throw' ,
41+ 'not ok ' + ++ count + ' should throw',
4142 ' ---' ,
4243 ' operator: throws' ,
4344 ' expected: undefined' ,
@@ -50,13 +51,13 @@ tap.test('failures', function (tt) {
5051 ' [... stack stripped ...]' ,
5152 ' ...' ,
5253 '# custom error messages' ,
53- 'ok 10 "message" is enumerable' ,
54- " ok 11 { custom: 'error', message: 'message' }" ,
55- 'ok 12 getter is still the same' ,
54+ 'ok ' + ++ count + ' "message" is enumerable',
55+ ' ok ' + ++ count + ' { custom: \ 'error\ ', message: \ 'message\ ' }' ,
56+ 'ok ' + ++ count + ' getter is still the same',
5657 '# throws null' ,
57- 'ok 13 throws null' ,
58+ 'ok ' + ++ count + ' throws null',
5859 '# wrong type of error' ,
59- 'not ok 14 throws actual' ,
60+ 'not ok ' + ++ count + ' throws actual',
6061 ' ---' ,
6162 ' operator: throws' ,
6263 ' expected: |-' ,
@@ -70,34 +71,34 @@ tap.test('failures', function (tt) {
7071 ' [... stack stripped ...]' ,
7172 ' ...' ,
7273 '# object' ,
73- 'ok 15 object properties are validated' ,
74+ 'ok ' + ++ count + ' object properties are validated',
7475 '# object with regexes' ,
75- 'ok 16 object with regex values is validated' ,
76+ 'ok ' + ++ count + ' object with regex values is validated',
7677 '# similar error object' ,
77- 'ok 17 throwing a similar error' ,
78+ 'ok ' + ++ count + ' throwing a similar error',
7879 '# validate with regex' ,
79- 'ok 18 regex against toString of error' ,
80+ 'ok ' + ++ count + ' regex against toString of error',
8081 '# custom error validation' ,
81- 'ok 19 error is SyntaxError' ,
82- 'ok 20 error matches /value/' ,
83- 'ok 21 unexpected error' ,
82+ 'ok ' + ++ count + ' error is SyntaxError',
83+ 'ok ' + ++ count + ' error matches /value/',
84+ 'ok ' + ++ count + ' unexpected error',
8485 '# throwing primitives' ,
85- 'ok 22 primitive: null' ,
86- 'ok 23 primitive: undefined' ,
87- 'ok 24 primitive: 0' ,
88- 'ok 25 primitive: NaN' ,
89- 'ok 26 primitive: 42' ,
90- 'ok 27 primitive: Infinity' ,
91- 'ok 28 primitive: \'\'' ,
92- 'ok 29 primitive: \'foo\'' ,
93- 'ok 30 primitive: true' ,
94- 'ok 31 primitive: false' ,
86+ 'ok ' + ++ count + ' primitive: null, no expected ',
87+ 'ok ' + ++ count + ' primitive: undefined, no expected ',
88+ 'ok ' + ++ count + ' primitive: 0, no expected ',
89+ 'ok ' + ++ count + ' primitive: NaN, no expected ',
90+ 'ok ' + ++ count + ' primitive: 42, no expected ',
91+ 'ok ' + ++ count + ' primitive: Infinity, no expected ',
92+ 'ok ' + ++ count + ' primitive: \'\', no expected ',
93+ 'ok ' + ++ count + ' primitive: \'foo\', no expected ',
94+ 'ok ' + ++ count + ' primitive: true, no expected ',
95+ 'ok ' + ++ count + ' primitive: false, no expected ',
9596 '# ambiguous arguments' ,
96- 'ok 32 Second' ,
97- 'ok 33 Second' ,
98- 'ok 34 Second' ,
99- 'ok 35 should throw' ,
100- 'not ok 36 should throw' ,
97+ 'ok ' + ++ count + ' Second',
98+ 'ok ' + ++ count + ' Second',
99+ 'ok ' + ++ count + ' Second',
100+ 'ok ' + ++ count + ' should throw',
101+ 'not ok ' + ++ count + ' should throw',
101102 ' ---' ,
102103 ' operator: throws' ,
103104 ' expected: |-' ,
@@ -113,10 +114,10 @@ tap.test('failures', function (tt) {
113114 ' [... stack stripped ...]' ,
114115 ' ...' ,
115116 '# non-extensible throw match' ,
116- 'ok 37 error is non-extensible' ,
117- 'ok 38 non-extensible error matches' ,
118- 'ok 39 errorWithMessage is non-extensible' ,
119- 'not ok 40 non-extensible error with message matches' ,
117+ 'ok ' + ++ count + ' error is non-extensible',
118+ 'ok ' + ++ count + ' non-extensible error matches',
119+ 'ok ' + ++ count + ' errorWithMessage is non-extensible',
120+ 'not ok ' + ++ count + ' non-extensible error with message matches',
120121 ' ---' ,
121122 ' operator: throws' ,
122123 ' expected: |-' ,
@@ -126,14 +127,14 @@ tap.test('failures', function (tt) {
126127 ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)' ,
127128 ' ...' ,
128129 '# frozen `message` property' ,
129- 'ok 41 error is non-writable' ,
130- 'ok 42 error is non-configurable' ,
131- 'ok 43 non-writable error matches' ,
130+ 'ok ' + ++ count + ' error is non-writable',
131+ 'ok ' + ++ count + ' error is non-configurable',
132+ 'ok ' + ++ count + ' non-writable error matches',
132133 '' ,
133- '1..43' ,
134- '# tests 43' ,
134+ '1..' + count ,
135+ '# tests ' + count ,
135136 '# pass 39' ,
136- '# fail 4' ,
137+ '# fail ' + ( count - 39 ) ,
137138 ''
138139 ] ) ;
139140 } ) ) ;
@@ -281,7 +282,7 @@ tap.test('failures', function (tt) {
281282
282283 test ( 'throwing primitives' , function ( t ) {
283284 [ null , undefined , 0 , NaN , 42 , Infinity , '' , 'foo' , true , false ] . forEach ( function ( primitive ) {
284- t . throws ( function ( ) { throw primitive ; } , 'primitive: ' + inspect ( primitive ) ) ;
285+ t . throws ( function ( ) { throw primitive ; } , 'primitive: ' + inspect ( primitive ) + ', no expected' ) ;
285286 } ) ;
286287
287288 t . end ( ) ;
0 commit comments