tap-parser
Advanced tools
Comparing version 9.1.0 to 9.2.0
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
var json = null | ||
var flat = false | ||
var bail = false | ||
@@ -36,2 +37,4 @@ var preserveWhitespace = true | ||
bail = true | ||
else if (arg === '-B' || arg === '--no-bail') | ||
bail = false | ||
else if (arg === '-t' || arg === '--tap') | ||
@@ -43,2 +46,6 @@ json = 'tap' | ||
usage() | ||
else if (arg === '-f' || arg === '--flat') | ||
flat = true | ||
else if (arg === '-F' || arg === '--no-flat') | ||
flat = false | ||
else | ||
@@ -88,2 +95,3 @@ console.error('Unrecognized arg: %j', arg) | ||
var yaml = require('tap-yaml') | ||
let id = 1 | ||
function tapFormat (msg, indent) { | ||
@@ -101,2 +109,6 @@ return indent + msg.map(function (item) { | ||
case 'plan': | ||
if (flat) { | ||
item[1].start = 1 | ||
item[1].end = id - 1 | ||
} | ||
var p = item[1].start + '..' + item[1].end | ||
@@ -114,4 +126,9 @@ if (item[1].comment) | ||
case 'result': | ||
case 'assert': | ||
var res = item[1] | ||
if (item[0] === 'result') { | ||
res.id = id++ | ||
res.name = (res.fullname + ' > ' + (res.name || '')).trim() | ||
} | ||
return (res.ok ? '' : 'not ') + 'ok ' + res.id + | ||
@@ -154,4 +171,20 @@ (res.name ? ' - ' + res.name.replace(/ \{$/, '') : '') + | ||
var parser = new Parser(options) | ||
var events = etoa(parser, [ 'pipe', 'unpipe', 'prefinish', 'finish', 'line' ]) | ||
const ignore = [ | ||
'pipe', | ||
'unpipe', | ||
'prefinish', | ||
'finish', | ||
'line', | ||
'pass', | ||
'fail', | ||
'todo', | ||
'skip', | ||
] | ||
if (flat) | ||
ignore.push('assert', 'child') | ||
else | ||
ignore.push('result') | ||
var events = etoa(parser, ignore) | ||
process.stdin.pipe(parser) | ||
@@ -158,0 +191,0 @@ if (json === 'lines') |
@@ -706,2 +706,3 @@ 'use strict' | ||
res.ok === c.results.ok && | ||
c.results.count && | ||
!res.todo && !res.skip) { | ||
@@ -708,0 +709,0 @@ // just procedural, ignore it |
{ | ||
"name": "tap-parser", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"description": "parse the test anything protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44524
1037
345