@tapjs/node-serialize
Stream TAP test data as a serialized node:test stream
Last updated a year ago by isaacs .
BlueOak-1.0.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @tapjs/node-serialize 
SYNC missed versions from official npm registry.

@tapjs/node-serialize

A default tap plugin that serializes the output of root TAP test for consumption by the node --test runner.

That is, this is for running tests that you write like:

import t from 'tap'
t.pass('this is fine')
// etc

and then run with node --test.

USAGE

This plugin is installed with tap by default. If you had previously removed it, you can tap plugin add @tapjs/node-serialize to bring it back.

When enabled, this plugin is activated when the NODE_TEST_CONTEXT environment variable is set to child-v8. When so activated, the root TAP test outputs a stream of node:test message objects (ie, the data emitted by Node's TestStream class) to standard output, instead of piping TAP data to standard output.

It has no effect on other tests within the suite.

To disable this behavior, run tap plugin rm @tapjs/node-serialize.

Caveat about Timing

Node-tap and node's built-in node:test are not quite identical in their approach.

Specifically, they have very different approaches to asynchronous testing. When using node:test, all tests are placed in a queue, and de-queued and started by level. It is considered an error for a test to perform any asynchronous actions outside of the scope of its parent suite method.

In tap, when t.jobs is set to some number greater than 1, tests may run in any order, and their subtests may also run in any order, at the same time as its siblings. While a subtest will never start before its parent, it may start after its parent's sibling tests, making the apparent nesting get interleaved in a strictly event-stream based tracking.

To handle this, this serializer creates a tree of subtests, and only emits the relevant node:test event messages all at once, in the correct order that node --test expects.

The downside of this is that it may appear that tests hang and then emit all of their data at once. If true in-progress reporting is desired, then you're probably better off using tap's built-in test runner.

Current Tags

  • 4.0.0                                ...           latest (6 months ago)

41 Versions

  • 4.0.0                                ...           6 months ago
  • 3.0.3                                ...           6 months ago
  • 3.0.2                                ...           6 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           6 months ago
  • 2.0.8                                ...           6 months ago
  • 2.0.7                                ...           6 months ago
  • 2.0.6                                ...           7 months ago
  • 2.0.5                                ...           7 months ago
  • 2.0.4                                ...           7 months ago
  • 2.0.3                                ...           7 months ago
  • 2.0.2                                ...           7 months ago
  • 2.0.1                                ...           7 months ago
  • 2.0.0                                ...           7 months ago
  • 1.3.4                                ...           7 months ago
  • 1.3.3                                ...           8 months ago
  • 1.3.2                                ...           9 months ago
  • 1.3.1                                ...           10 months ago
  • 1.3.0                                ...           a year ago
  • 1.2.6                                ...           a year ago
  • 1.2.5                                ...           a year ago
  • 1.2.4                                ...           a year ago
  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.10                                ...           a year ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (2)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE