Skip to content

Instantly share code, notes, and snippets.

@morganrallen
Created January 22, 2016 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganrallen/c1b4b6db0fd2a64a6d0d to your computer and use it in GitHub Desktop.
Save morganrallen/c1b4b6db0fd2a64a6d0d to your computer and use it in GitHub Desktop.
Abusing tape reporting stream to provide post-test cleanup
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "tape test*.js"
},
"author": "",
"license": "ISC"
}
var test = require("tape");
var ts = test.createStream();
ts.pipe(process.stdout);
ts.on("end", function() {
console.log("Bye!");
});
test(function(t) {
t.pass();
t.end();
});
var test = require("tape");
test(function(t) {
t.pass();
t.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment