Last active
October 19, 2016 01:37
-
-
Save KoryNunn/a7ddbfb069bbbb2a41b4 to your computer and use it in GitHub Desktop.
tape async series tests
This file contains 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'), | |
righto = require('righto'), | |
noop = function(){}, | |
last = righto.sync(noop); | |
module.exports = function(name, options, task){ | |
if(arguments.length < 3){ | |
task = options; | |
options = null; | |
} | |
test(name, options, function(t){ | |
last = righto(function(done){ | |
t.on('end', done); | |
task(t, done); | |
}, righto.after(last)); | |
last(noop); | |
}); | |
}; | |
module.exports.only = test.only; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment