Giter Club home page Giter Club logo

tap-closer's Introduction

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.

tap-closer's People

Contributors

hughsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tap-closer's Issues

always process exits (0)

it appears that using this tool with tap-spec in the pipeline works as expected... but if you use the tool without tap-spec it always process exists (0)

I appreciate all my tests passing... but not when they don't pass :P
Looking into what is going on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.