tap-parser
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -53,3 +53,3 @@ #!/usr/bin/env node | ||
var parser = new Parser() | ||
var events = etoa(parser, [ 'pipe', 'unpipe', 'prefinish', 'finish' ]) | ||
var events = etoa(parser, [ 'pipe', 'unpipe', 'prefinish', 'finish', 'line' ]) | ||
@@ -56,0 +56,0 @@ process.stdin.pipe(parser) |
16
index.js
@@ -356,6 +356,14 @@ // Transforms a stream of TAP into a stream of result objects | ||
// still belongs to the child. | ||
if (this.child && line.indexOf(this.child.indent) === 0) { | ||
line = line.substr(this.child.indent.length) | ||
this.child.write(line) | ||
return | ||
if (this.child) { | ||
if (line.indexOf(this.child.indent) === 0) { | ||
line = line.substr(this.child.indent.length) | ||
this.child.write(line) | ||
return | ||
} | ||
// a child test can only end when we get an test point line. | ||
// anything else is extra. | ||
if (!/^(not )?ok/.test(line)) { | ||
this.emit('extra', line) | ||
return | ||
} | ||
} | ||
@@ -362,0 +370,0 @@ |
{ | ||
"name": "tap-parser", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "parse the test anything protocol", | ||
@@ -49,3 +49,6 @@ "main": "index.js", | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"optionalDependencies": { | ||
"readable-stream": "^1.1.13" | ||
} | ||
} |
@@ -26,6 +26,3 @@ module.exports = | ||
[ 'line', ' ...\n' ], | ||
[ 'child', | ||
[ [ 'line', '...\n' ], | ||
[ 'extra', '...\n' ], | ||
[ 'complete', { ok: false, count: 0, pass: 0 } ] ] ], | ||
[ 'extra', ' ...\n' ], | ||
[ 'line', 'ok 2 - child test\n' ], | ||
@@ -32,0 +29,0 @@ [ 'line', 'ok 3 - should come last\n' ], |
235666
79
4864
4