# tap-set-exit

> Sets the exit code appropriately, given some tap output.

Latest version **1.1.1** (published 2015-09-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install tap-set-exit
pnpm add tap-set-exit
yarn add tap-set-exit
bun add tap-set-exit
```

Provides the command `tap-set-exit`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-09-16 |
| First published | 2015-09-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Urban Airship |
| Maintainers | ua |
| Keywords | tap, test |

## Links

- npm: https://www.npmjs.com/package/tap-set-exit
- Repository: https://github.com/urbanairship/tap-set-exit
- Homepage: https://github.com/urbanairship/tap-set-exit#readme
- Issues: https://github.com/urbanairship/tap-set-exit/issues
- npm.io page: https://npm.io/package/tap-set-exit

## Dependencies (1)

- [tap-parser](https://npm.io/package/tap-parser.md) ^1.0.4

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2015-09-16

## README

# tap-set-exit

Sets the correct exit code based on tap output.

[![Build Status](http://img.shields.io/travis/urbanairship/tap-set-exit/master.svg?style=flat)](https://travis-ci.org/urbanairship/tap-set-exit)
[![npm install](http://img.shields.io/npm/dm/tap-set-exit.svg?style=flat)](https://www.npmjs.org/package/tap-set-exit)

## Usage

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

```bash
$ 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:

```javascript
// 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]:

```bash
$ 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][license] for the full license.

[license]: ./LICENSE
[jsdom]: https://github.com/tmpvar/jsdom
[phantomjs]: http://phantomjs.org/
[browserify]: http://browserify.org/

---
_Source: https://npm.io/package/tap-set-exit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
