tap_parser
Stream that receives TAP, parses it, and emits objects of parsed TAP.
Last updated 4 years ago by m59 .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tap_parser 
SYNC missed versions from official npm registry.

tap_parser

Stream that receives TAP, parses it, and emits objects of parsed TAP.

Adheres strictly and entirely to the TAP13 Specification.

install

npm install tap_parser

example

const parser = require('tap_parser')
const though = require('throo')

process.stdin
  .pipe(parser())
  .pipe(through((push, chunk, enc, cb) => {
    chunk // object of parsed TAP
  }))
# output parsed TAP as JSON
npm test | tap_parser

parsed TAP

All objects have this structure:

  • type: Type of TAP (version, plan, test, etc)
  • value: The original TAP that was input
  • parsed: Object representation of TAP (see below)

Lines that are not TAP will have type: 'unknown' and will not have a "parsed" property.

version

  • version: string

plan

  • start: number
  • end: number
  • skip: string

test

  • ok: boolean
  • point: number
  • description: string
  • skip: boolean | string Will be string if there is a message, true if not
  • todo: boolean | string Will be string if there is a message, true if not
  • document: object Parsed YAML document

bailout

  • reason: string

diagnostic

  • message: string

unknown

notes

Test lines may or may not be followed by an associated document. The parser will hold test lines until the next line comes in so that the document can be parsed and added to the test. This is usually not important to know, but this can be a "gotcha" in some cases. For example, a test that writes a test line to the stream and nothing afterward will hang waiting for another line.

Current Tags

  • 1.0.4                                ...           latest (4 years ago)

4 Versions

  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 1
Last Month 1
Dependencies (6)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |