File tree 3 files changed +66
-0
lines changed
3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -148,3 +148,57 @@ tap.test('more planned in a second test', function (t) {
148
148
t . notEqual ( code , 0 ) ;
149
149
} ) ;
150
150
} ) ;
151
+
152
+ tap . test ( 'todo passing' , function ( t ) {
153
+ t . plan ( 2 ) ;
154
+
155
+ var tc = function ( rows ) {
156
+ t . same ( stripFullStack ( rows . toString ( 'utf8' ) ) , [
157
+ 'TAP version 13' ,
158
+ '# todo pass' ,
159
+ 'ok 1 should be truthy # TODO' ,
160
+ '' ,
161
+ '1..1' ,
162
+ '# tests 1' ,
163
+ '# pass 1' ,
164
+ '' ,
165
+ '# ok'
166
+ ] . join ( '\n' ) + '\n\n' ) ;
167
+ } ;
168
+
169
+ var ps = spawn ( process . execPath , [ path . join ( __dirname , '/exit/todo.js' ) ] ) ;
170
+ ps . stdout . pipe ( concat ( tc ) ) ;
171
+ ps . on ( 'exit' , function ( code ) {
172
+ t . equal ( code , 0 ) ;
173
+ } ) ;
174
+ } ) ;
175
+
176
+ tap . test ( 'todo failing' , function ( t ) {
177
+ t . plan ( 2 ) ;
178
+
179
+ var tc = function ( rows ) {
180
+ t . same ( stripFullStack ( rows . toString ( 'utf8' ) ) , [
181
+ 'TAP version 13' ,
182
+ '# todo fail' ,
183
+ 'not ok 1 should be truthy # TODO' ,
184
+ ' ---' ,
185
+ ' operator: ok' ,
186
+ ' expected: true' ,
187
+ ' actual: false' ,
188
+ ' at: Test.<anonymous> ($TEST/exit/todo_fail.js:$LINE:$COL)' ,
189
+ ' ...' ,
190
+ '' ,
191
+ '1..1' ,
192
+ '# tests 1' ,
193
+ '# pass 1' ,
194
+ '' ,
195
+ '# ok'
196
+ ] . join ( '\n' ) + '\n\n' ) ;
197
+ } ;
198
+
199
+ var ps = spawn ( process . execPath , [ path . join ( __dirname , '/exit/todo_fail.js' ) ] ) ;
200
+ ps . stdout . pipe ( concat ( tc ) ) ;
201
+ ps . on ( 'exit' , function ( code ) {
202
+ t . equal ( code , 0 ) ;
203
+ } ) ;
204
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var test = require ( '../../' ) ;
2
+
3
+ test ( 'todo pass' , { todo : true } , function ( t ) {
4
+ t . plan ( 1 ) ;
5
+ t . ok ( true ) ;
6
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var test = require ( '../../' ) ;
2
+
3
+ test ( 'todo fail' , { todo : true } , function ( t ) {
4
+ t . plan ( 1 ) ;
5
+ t . ok ( false ) ;
6
+ } ) ;
You can’t perform that action at this time.
0 commit comments