Skip to content

Instantly share code, notes, and snippets.

@juliangruber
Created September 8, 2014 15:27
Show Gist options
  • Save juliangruber/d680eef1a755ecbb23eb to your computer and use it in GitHub Desktop.
Save juliangruber/d680eef1a755ecbb23eb to your computer and use it in GitHub Desktop.
var tap = require('tap');
var runner = require('..');
module.exports = function(opts){
var tests = [];
opts.runTest = function*(t){
tests.forEach(function(test){
tap.test(test.name, function(t){
t.browser = getBrowser();
test.fn(t);
});
});
};
process.nextTick(function(){
runner(opts);
});
return function test(name, fn){
if (arguments.length == 1) {
fn = name;
name = undefined;
}
tests.push({ name: name, fn: fn });
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment