Permalink
Browse files

[tap] added support for node tap

  • Loading branch information...
1 parent 5e20e53 commit 76b4dc00b499a3318591b1eb8abeebebd9b190eb @dscape committed Sep 9, 2011
Showing with 22 additions and 2 deletions.
  1. +20 −0 engines/tap.js
  2. +1 −1 package.json
  3. +1 −1 test/use.js
View
@@ -0,0 +1,20 @@
+var _ = require('underscore')
+ , tap = require('tap')
+ , test = tap.test
+ , plan = tap.plan
+ ;
+
+module.exports = exports = function(name,tests,module,selected) {
+ var f, ok, test_names, total;
+ if(selected) { test_names = selected.split(','); }
+ else { test_names =
+ _.filter(_.keys(tests), function(e) { return e.indexOf('_ok') === -1; });
+ }
+ total = test_names.length;
+ test(name, function (t) {
+ t.plan(total);
+ test_names.forEach(function(name) {
+ tests[name](tests[name+'_ok'](t));
+ });
+ });
+};
View
@@ -7,7 +7,7 @@
, "keywords": ["vows", "testing"]
, "dependencies":
{ "vows": "~0.5.10"
- , "node-tap": "0.0.9"
+ , "tap": "0.0.9"
, "underscore": "~1.1.7"
}
, "scripts": { "test": "./test/run" }
View
@@ -6,4 +6,4 @@ var ensure = require('../ensure').use('vows')
tests.vows = function (cb) { cb(true); };
tests.vows_ok = function (t) { assert.ok(t); };
-ensure((__filename + '_vows'),tests,module);
+ensure((__filename + '_use'),tests,module);

0 comments on commit 76b4dc0

Please sign in to comment.