tap-closer
Simple JS "transform" tool that will call window.close or process.exit when TAP output is complete
Last updated 10 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tap-closer 
SYNC missed versions from official npm registry.

tap-closer

Simple 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:

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.

NPM

CLI Usage

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:

cat bundle.js | tap-closer > bundle-closer.js

Using Directly

All the CLI is doing is prepending the browserified contents of instrument.js to whatever JavaScript is being piped in. You can do this yourself with the module's bundle.js once installed, e.g.:

cat node_modules/tap-closer/bundle.js bundle.js > bundle-closer.js

Though it's generally nicer/safer using the CLI :)

License

MIT. See LICENSE.md for details.

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

1 Versions

  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

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