Created
January 22, 2016 17:40
-
-
Save morganrallen/c1b4b6db0fd2a64a6d0d to your computer and use it in GitHub Desktop.
Abusing tape reporting stream to provide post-test cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "tape test*.js" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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