# blue-tape

> Tape test runner with promise support

Latest version **1.0.0** (published 2016-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install blue-tape
pnpm add blue-tape
yarn add blue-tape
bun add blue-tape
```

Provides the command `blue-tape`.

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-09-05 |
| First published | 2013-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/blue-tape) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 205 |
| Author | spion |
| Maintainers | spion |
| Keywords | tape, bluebird, promises |

## Links

- npm: https://www.npmjs.com/package/blue-tape
- Repository: https://github.com/spion/blue-tape
- Homepage: https://github.com/spion/blue-tape#readme
- Issues: https://github.com/spion/blue-tape/issues
- npm.io page: https://npm.io/package/blue-tape

## Dependencies (1)

- [tape](https://npm.io/package/tape.md) >=2.0.0 <5.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-09-05
- 0.2.0 — 2016-02-05
- 0.1.11 — 2015-11-27
- 0.1.10 — 2015-07-07
- 0.1.9 — 2015-05-14
- 0.1.8 — 2014-10-18
- 0.1.7 — 2014-07-15
- 0.1.6 — 2014-01-27
- 0.1.5 — 2013-10-18
- 0.1.3 — 2013-10-10
- 0.1.1 — 2013-10-10
- 0.1.0 — 2013-10-10

## README

# blue-tape

Tape with promise support.

### Usage

Same as [tape](https://github.com/substack/tape), except if you return a promise from a test,
it will be checked for errors. If there are no errors, the test will end. Otherwise the test
will fail. This means there is no need to use `t.plan()` or `t.end()`.

Also provides `t.shouldFail(promise P, optional class|regex expected, optional message)` (as
well as the alias `shouldReject`) which returns a new promise that resolves successfully if `P`
rejects. If you provide the optional class, or regex then it additionally ensures that `err` is
an instance of that class or that the message matches the regular expression. The behaviour is
identical to tape's `throws` assertion.

### Examples

Assuming `delay()` returns a promise:

```js
const test = require('blue-tape');

test("simple delay", function(t) {
    return delay(1);
});

test("should fail", function(t) {
    return delay(1).then(function() {
        throw new Error("Failed!");
    });
});
```

Assuming `failDelay()` returns a promise that rejects with a DerpError:

```js
test("promise fails but test succeeds", function(t) {
    return t.shouldFail(failDelay(), DerpError);
});
```

### License

MIT

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