https://github.com/bysabi/tap-lochnest
A TAP helper for output nested test name beside parent test name.
https://github.com/bysabi/tap-lochnest
Last synced: 5 months ago
JSON representation
A TAP helper for output nested test name beside parent test name.
- Host: GitHub
- URL: https://github.com/bysabi/tap-lochnest
- Owner: bySabi
- License: isc
- Created: 2016-08-02T10:13:35.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-04T16:30:39.000Z (about 7 years ago)
- Last Synced: 2025-02-23T04:28:25.478Z (5 months ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# tap-lochnest (TAP Loch Nest)
[](https://badge.fury.io/js/tap-lochnest)
[](https://www.npmjs.com/package/tap-lochnest)
[](https://travis-ci.org/bySabi/tap-lochnest)
[](https://ci.appveyor.com/project/bySabi/tap-lochnest)
[](https://paypal.me/bySabi/10)> A TAP helper for output nested test name beside parent test name.

## Installation
### npm
```bash
npm install tap-lochnest --save-dev
```## Usage
```javascript
var lochNest = require('tap-lochnest');
``````javascript
var tape = require('tape');
var test = lochNest(tape, { delimiter: ' | ' });var count = 0;
test('a set of some tests', function (t) {
t.test('A', function (t) {
t.equal(++count, 1);
t.end();
});t.test('B', function (t) {
t.test('b1', function (t) {
t.test('bb1', function (t) {
t.equal(++count, 2);
t.end();
});
t.end();
});t.test('b2', function (t) {
t.equal(++count, 3);
t.end();
});t.test('b3', function (t) {
t.equal(++count, 4);
t.end();
});t.end();
});t.test('C', function (t) {
t.equal(++count, 5);
t.end();
});t.end();
});test('a test', function (t) {
t.equal(++count, 6);
t.end();
});
```TAP Output
```bash
TAP version 13
# a set of some tests
# a set of some tests | A
ok 1 should be equal
# a set of some tests | B
# a set of some tests | B | b1
# a set of some tests | B | b1 | bb1
ok 2 should be equal
# a set of some tests | B | b2
ok 3 should be equal
# a set of some tests | B | b3
ok 4 should be equal
# a set of some tests | C
ok 5 should be equal
# a test
ok 6 should be equal1..6
# tests 6
# pass 6# ok
```## `delimiter` option
Default nested test name separator is a `space`, but can be customize.Ex:
```js
var test = lochNest(tape, { delimiter: ' | ' });
```## TAP Frameworks
Work with [tape](https://github.com/substack/tape) on `node` and `browser`## Contributing
* Documentation improvement
* Feel free to send any PR## License
[ISC][isc-license]
[isc-license]:./LICENSE