tap-set-exit
Sets the exit code appropriately, given some tap output.
Last updated 5 years ago by ua .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tap-set-exit 
SYNC missed versions from official npm registry.

tap-set-exit

Sets the correct exit code based on tap output.

Build Status npm install

Usage

Exposes a CLI tool tap-set-exit, which can be used as follows:

$ cat some-test-output.txt | tap-set-exit

Where this is most useful is running tests in an environment like jsdom or phantomjs where the correct exit code would not be set.

For an always failing test:

// file: fail.js
var test = require('tape')

test('always fails', function(t) {
  t.fail()
  t.end()
})

Run in a jsdom context after being browserified:

$ browserify fail.js | jsdom-eval | tap-set-exit

TAP version 13
# always fails 
not ok 1 (unnamed assert)

1..1
# tests 1
# pass  0
# fail  1

# ok

$ echo $?
1

Output from the tap-producing command is passed through unmodified; only the exit code is set.

License

This project is licensed under the Apache License, Version 2.0. See LICENSE for the full license.

Current Tags

  • 1.1.1                                ...           latest (5 years ago)

1 Versions

  • 1.1.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |