Socket
Socket
Sign inDemoInstall

tap-parser

Package Overview
Dependencies
Maintainers
2
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tap-parser - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

test/fixtures/indented-stdout-noise.js

24

index.js

@@ -100,2 +100,3 @@ // Transforms a stream of TAP into a stream of result objects

this.sawValidTap = false
this.indent = options.indent || ''

@@ -248,2 +249,9 @@ this.level = options.level || 0

// We didn't get any actual tap, so just treat this like a
// 1..0 test, because it was probably just console.log junk
if (!this.sawValidTap) {
final.plan = { start: 1, end: 0 }
final.ok = true
}
this.emit('complete', final)

@@ -294,2 +302,7 @@

Parser.prototype.startChild = function (indent, line) {
if (!line.substr(indent.length).match(/^# Subtest:/)) {
this.emit('extra', line)
return
}
this.emitResult()

@@ -307,3 +320,3 @@

this.child.on('complete', function (results) {
if (!results.ok)
if (this.sawValidTap && !results.ok)
self.ok = false

@@ -337,2 +350,3 @@ })

if (bailout) {
this.sawValidTap = true
var reason = bailout[1].trim()

@@ -369,3 +383,3 @@ this.bailout(reason)

// anything else is extra.
if (!/^(not )?ok/.test(line)) {
if (this.child.sawValidTap && !/^(not )?ok/.test(line)) {
this.emit('extra', line)

@@ -380,4 +394,4 @@ return

// if we don't have a current res, then it can't be yamlish,
// must be a child result set
// if we don't have a current res, then it can't be yamlish.
// If it is a subtest command, then it's a child test.
if (!this.current) {

@@ -438,2 +452,3 @@ this.startChild(indent, line)

this.sawValidTap = true
this.emitResult()

@@ -468,2 +483,3 @@

this.sawValidTap = true
if (res.id) {

@@ -470,0 +486,0 @@ if (!this.first || res.id < this.first)

2

package.json
{
"name": "tap-parser",
"version": "1.1.3",
"version": "1.1.4",
"description": "parse the test anything protocol",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,24 +6,13 @@ module.exports =

[ 'line', ' ok:\n' ],
[ 'assert', { ok: true, id: 1, name: 'callback happened' } ],
[ 'child',
[ [ 'line', 'ok:\n' ],
[ 'line', ' - I wished for a bailout!\n' ],
[ 'assert', { ok: true, id: 1, name: ':' } ],
[ 'child',
[ [ 'line', '- I wished for a bailout!\n' ],
[ 'extra', '- I wished for a bailout!\n' ],
[ 'line',
'- lots of other shapes here can look like valid tap\n' ],
[ 'extra',
'- lots of other shapes here can look like valid tap\n' ],
[ 'complete', { ok: false, count: 0, pass: 0 } ] ] ],
[ 'line',
' - lots of other shapes here can look like valid tap\n' ],
[ 'complete', { ok: false, count: 1, pass: 1 } ] ] ],
[ 'extra', ' ok:\n' ],
[ 'line', ' - I wished for a bailout!\n' ],
[ 'extra', ' - I wished for a bailout!\n' ],
[ 'line',
' - lots of other shapes here can look like valid tap\n' ],
[ 'extra',
' - lots of other shapes here can look like valid tap\n' ],
[ 'line', ' ...\n' ],
[ 'extra', ' ...\n' ],
[ 'line', 'ok 2 - child test\n' ],
[ 'assert', { ok: true, id: 1, name: 'callback happened' } ],
[ 'line', 'ok 3 - should come last\n' ],

@@ -33,2 +22,2 @@ [ 'assert', { ok: true, id: 2, name: 'child test' } ],

[ 'complete',
{ ok: false, count: 3, pass: 3, plan: { start: 1, end: 3 } } ] ]
{ ok: true, count: 3, pass: 3, plan: { start: 1, end: 3 } } ] ]

@@ -8,5 +8,7 @@ module.exports =

[ 'comment', '# nesting\n' ],
[ 'line', ' 1..2\n' ],
[ 'line', ' # Subtest: first\n' ],
[ 'child',
[ [ 'line', '1..2\n' ],
[ [ 'line', '# Subtest: first\n' ],
[ 'comment', '# Subtest: first\n' ],
[ 'line', '1..2\n' ],
[ 'plan', { start: 1, end: 2 } ],

@@ -21,13 +23,18 @@ [ 'line', 'ok 1 - true is ok # time=1.234ms\n' ],

{ ok: true, count: 2, pass: 2, plan: { start: 1, end: 2 } } ] ] ],
[ 'line', ' 1..2\n' ],
[ 'line', ' ok 1 - true is ok # time=1.234ms\n' ],
[ 'line', ' ok 2 - doag is also okay # time=1.234ms\n' ],
[ 'line', 'ok 1 - first # time=2.589ms\n' ],
[ 'line', ' ok 1 - no plan # time=1.001ms\n' ],
[ 'line', ' # Subtest: second\n' ],
[ 'assert', { ok: true, id: 1, time: 2.589, name: 'first' } ],
[ 'child',
[ [ 'line', 'ok 1 - no plan # time=1.001ms\n' ],
[ 'line', ' 1..3\n' ],
[ [ 'line', '# Subtest: second\n' ],
[ 'comment', '# Subtest: second\n' ],
[ 'line', 'ok 1 - no plan # time=1.001ms\n' ],
[ 'line', ' # Subtest: this passes\n' ],
[ 'assert', { ok: true, id: 1, time: 1.001, name: 'no plan' } ],
[ 'child',
[ [ 'line', '1..3\n' ],
[ [ 'line', '# Subtest: this passes\n' ],
[ 'comment', '# Subtest: this passes\n' ],
[ 'line', '1..3\n' ],
[ 'plan', { start: 1, end: 3 } ],

@@ -66,2 +73,3 @@ [ 'line', 'not ok granddaughter # SKIP for no raisin\n' ],

plan: { start: 1, end: 3 } } ] ] ],
[ 'line', ' 1..3\n' ],
[ 'line', ' not ok granddaughter # SKIP for no raisin\n' ],

@@ -86,2 +94,4 @@ [ 'line', ' ok grandson # time=1.001ms\n' ],

{ ok: true, count: 2, pass: 2, plan: { start: 1, end: 2 } } ] ] ],
[ 'line', ' ok 1 - no plan # time=1.001ms\n' ],
[ 'line', ' # Subtest: this passes\n' ],
[ 'line', ' 1..3\n' ],

@@ -88,0 +98,0 @@ [ 'line',

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc