Nonstop Progressive Marxism
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

tap-strings

1.0.1 • Public • Published

tap-strings

Generate valid TAP output as strings.

API

const parse = require('tap-strings')

parse.version(number)

parse.version(13) // => `TAP version 13`

parse.plan(start, end)

parse.plan(1, 5) // => `1..5`

parse.test(ok, number, [description])

parse.test(true, 1, `lookin' cool my man`) // => `ok 1 lookin' cool my man`

parse.todo(ok, number, [descriptor, [directive]])

const todoOutput = parse.todo(false, 2, `everything's groovy`, `Fix this later`)
todoOutput // => `not ok 2 everything's groovy # TODO Fix this later`

parse.skip(ok, number, [descriptor, [directive]])

parse.skip(true, 3, null, `Don't care`) // => `ok 3 # SKIP Don't care`

parse.bail([message])

parse.bail(`eek`) // => `Bail out! eek`

parse.diagnostic([message])

parse.diagnostic(`yo`) // => `# yo`

parse.message(message)

const messageOutput = parse.message(`This is totally
a multiline string`)
 
const expected = `  ---
  message: |-
    This is totally
    a multiline string
  ...`
 
messageOutput // => expected
 

License

WTFPL

Install

npm i tap-strings

DownloadsWeekly Downloads

2

Version

1.0.1

License

WTFPL

Last publish

Collaborators

  • avatar