Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[tap] now works with this instead of encapsulation

  • Loading branch information...
commit 6ad49f5ae4e0e6517d6099c433251a7e3b4b5907 1 parent dedb3f5
@dscape authored
Showing with 7 additions and 5 deletions.
  1. +1 −1  engines/tap.js
  2. +6 −4 test/tap.js
View
2  engines/tap.js
@@ -14,7 +14,7 @@ module.exports = exports = function(name,tests,module,selected) {
test(name, function (t) {
t.plan(total);
test_names.forEach(function(name) {
- tests[name](tests[name+'_ok'](t));
+ tests[name](function () { this.t = t; return tests[name+'_ok'] }());
});
});
};
View
10 test/tap.js
@@ -3,13 +3,15 @@ var ensure = require('../ensure').use('tap')
;
tests.tap = function (cb) { cb('foo'); };
-tests.tap_ok = function (t) {
- return function (value) { t.equal(value,'foo'); };
+tests.tap_ok = function (value) {
+ var t = this.t;
+ t.equal(value,'foo');
};
tests.plan_works = function (cb) { cb('bar'); };
-tests.plan_works_ok = function (t) {
- return function (value) { t.equal(value,'bar'); };
+tests.plan_works_ok = function (value) {
+ var t = this.t;
+ t.equal(value,'bar');
};
ensure((__filename + '_tap'),tests,module);
Please sign in to comment.
Something went wrong with that request. Please try again.