JSPM

tap-lochnest

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q31499F
  • License ISC

A TAP helper for output nested test name beside parent test name.

Package Exports

  • tap-lochnest

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tap-lochnest) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tap-lochnest (TAP Loch Nest)

npm version npm downloads Build Status Windows Tests bitHound Overall Score Donate

A TAP helper for output nested test name beside parent test name.

tap-lochnesttape

Installation

npm

npm install tap-lochnest --save-dev

Usage

var lochNest = require('tap-lochnest');
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

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 equal

1..6
# tests 6
# pass  6

# ok

delimiter option

Default nested test name separator is a space, but can be customize.

Ex:

var test = lochNest(tape, { delimiter: ' | ' });

TAP Frameworks

Work with tape on node and browser

Contributing

  • Documentation improvement
  • Feel free to send any PR

License

ISC