JSPM

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

A Test-Anything-Protocol library for JavaScript

Package Exports

  • libtap

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 (libtap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

libtap

A TAP test library for Node.js.

libtap vs tap

tap extends this module and provides many other nice features. Generally you should be using require('tap') instead of require('libtap'). In some edge cases it can be appropriate to use libtap directly.

  • Install size is important - libtap has significantly less dependencies.
  • Your tests are suspectable to transformations or other environmental changes. tap does things that are useful by default, if this causes problems for your code you may wish to go lower level.

Recursive rmdir

Some parts of libtap require a recursive rmdirSync function. In node.js 12.10.0+ the default implementation is dir => fs.rmdirSync(dir, {recursive: true}). For older versions of node.js you must either install rimraf or set require('libtap/settings').rmdirRecursiveSync with another implementation. tap installs rimraf unconditionally so this is only a concern to direct libtap users who support older versions of node.js.

It is not considered semver-major for a libtap function to use recursive rmdir where it previously did not. If you test on older versions of node.js then you must ensure a user-space implementation is available even if it is not currently needed.

Environmental changes still in place

  • signal-exit is run
  • async-domain-hook is run
  • process.stdout.emit is monkey-patched to swallow EPIPE errors
  • process.reallyExit and process.exit are monkey-patched
  • Handlers are added to process beforeexit and exit events

These all have an effect on the environment and may be undesirable in some edge cases. Should any/all of these be opt-out or even opt-in? The goal is to be able to create functional tests using require('libtap').