Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

tap-set-exit

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tap-set-exit

Sets the exit code appropriately, given some tap output.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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.

Keywords

tap

FAQs

Package last updated on 16 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts