File tree 1 file changed +19
-24
lines changed
1 file changed +19
-24
lines changed Original file line number Diff line number Diff line change 1
1
var tape = require ( '../' ) ;
2
2
var tap = require ( 'tap' ) ;
3
- var trim = require ( 'string.prototype.trim ' ) ;
3
+ var concat = require ( 'concat-stream ' ) ;
4
4
5
5
tap . test ( 'timeoutAfter test' , function ( tt ) {
6
6
tt . plan ( 1 ) ;
7
-
7
+
8
8
var test = tape . createHarness ( ) ;
9
- var tc = tap . createConsumer ( ) ;
10
-
11
- var rows = [ ] ;
12
- tc . on ( 'data' , function ( r ) { rows . push ( r ) } ) ;
13
- tc . on ( 'end' , function ( ) {
14
- var rs = rows . map ( function ( r ) {
15
- if ( r && typeof r === 'object' ) {
16
- return { id : r . id , ok : r . ok , name : trim ( r . name ) } ;
17
- }
18
- else return r ;
19
- } ) ;
20
- tt . same ( rs , [
9
+ var tc = function ( rows ) {
10
+ tt . same ( rows . toString ( 'utf8' ) , [
21
11
'TAP version 13' ,
22
- 'timeoutAfter' ,
23
- { id : 1 , ok : false , name : 'test timed out after 1ms' } ,
24
- 'tests 1' ,
25
- 'pass 0' ,
26
- 'fail 1'
27
- ] ) ;
28
- } ) ;
29
-
30
- test . createStream ( ) . pipe ( tc ) ;
31
-
12
+ '# timeoutAfter' ,
13
+ 'not ok 1 test timed out after 1ms' ,
14
+ ' ---' ,
15
+ ' operator: fail' ,
16
+ ' ...' ,
17
+ '' ,
18
+ '1..1' ,
19
+ '# tests 1' ,
20
+ '# pass 0' ,
21
+ '# fail 1'
22
+ ] . join ( '\n' ) + '\n' ) ;
23
+ } ;
24
+
25
+ test . createStream ( ) . pipe ( concat ( tc ) ) ;
26
+
32
27
test ( 'timeoutAfter' , function ( t ) {
33
28
t . plan ( 1 ) ;
34
29
t . timeoutAfter ( 1 ) ;
You can’t perform that action at this time.
0 commit comments