Simple JS "transform" tool that will call window.close or process.exit when TAP output is complete
npm install tap-closerSimple JS "transform" tool that will call window.close or process.exit when
TAP output is complete.
Useful, for example, in combination with
smokestack and
tape and
browserify for testing npm modules
in the browser:
`` bash`
browserify test/*.js | tap-closer | smokestack | tap-spec
Note however that this isn't specific to browserify or smokestack or tape, you
can use this with any JavaScript tool that logs TAP output to your console.

The CLI for tap-closer modifies your JavaScript file to capture console.log
calls and work out when a TAP test is finished, closing your browser or Node
process once this happens. It accepts input from stdin only, and outputs to
stdout only, so you would use it like so:
` bash`
cat bundle.js | tap-closer > bundle-closer.js
All the CLI is doing is prepending the browserified contents of instrument.jsbundle.js
to whatever JavaScript is being piped in. You can do this yourself with the
module's once installed, e.g.:
` bash``
cat node_modules/tap-closer/bundle.js bundle.js > bundle-closer.js
Though it's generally nicer/safer using the CLI :)
MIT. See LICENSE.md for details.