# supertap

> Generate TAP output

Latest version **3.0.1** (published 2022-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install supertap
pnpm add supertap
yarn add supertap
bun add supertap
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2022-02-06 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 4 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Vadim Demedes |
| Maintainers | novemberborn, vdemedes |
| Keywords | tap, tape, output |

## Links

- npm: https://www.npmjs.com/package/supertap
- Repository: https://github.com/vadimdemedes/supertap
- Homepage: https://github.com/vadimdemedes/supertap#readme
- Issues: https://github.com/vadimdemedes/supertap/issues
- npm.io page: https://npm.io/package/supertap

## Dependencies (4)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.1
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^7.0.1
- [indent-string](https://npm.io/package/indent-string.md) ^5.0.0
- [serialize-error](https://npm.io/package/serialize-error.md) ^7.0.1

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 3.0.1 (latest) — 2022-02-06
- 3.0.0 — 2022-02-04
- 2.0.0 — 2020-12-23
- 1.0.0 — 2017-12-09

## README

<h1 align="center">
	<br>
	<img width="300" src="media/logo.png" alt="SUPERTAP">
	<br>
	<br>
	<br>
</h1>

[![Build Status](https://travis-ci.org/vadimdemedes/supertap.svg?branch=master)](https://travis-ci.org/vadimdemedes/supertap)

> Generate TAP output


## Install

```
$ npm install supertap
```


## Usage

```js
import * as supertap from 'supertap';

console.log(supertap.start());

console.log(supertap.test('passing', {
	index: 1,
	passed: true
}));

console.log(supertap.finish({
	passed: 1
}));
```

Output:

```
TAP version 13
# passing
ok 1 - passing

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


## API

### start()

Always returns `'TAP version 13'` string.

### test(title, options)

#### title

Type: `string`

Test title.

#### options

##### index

Type: `number`

Index of the test. Should start with one, not zero.

##### passed

Type: `boolean`<br>
Default: `false`

Status of the test.

##### error

Type: `Error` `object`

If test has failed (`passed` is `false`), `error` should be an instance of an actual error.
It can also be an object, which fields will be included in the output (e.g. `name`, `message`, `actual`, `expected`).

```js
supertest.test('failing', {
	index: 1,
	passed: false,
	error: new Error()
});
```

##### todo
##### skip

Type: `boolean`<br>
Default: `false`

Mark test as to-do or as skipped.

##### comment

Type: `string` `array`

Comments for that test.

### finish(stats)

#### stats

##### passed
##### failed
##### skipped
##### todo
##### crashed

Type: `number`<br>
Default: `0`

Number of tests that passed, failed, skipped or marked as todo. `crashed` is a special option, which adds to failed test count in the output, but not total test count. AVA uses it to count unhandled exceptions.

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