Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cb test, passes

  • Loading branch information...
commit fd559df60a949265ed90dda655c57120bf565cba 1 parent 41ff255
@substack authored
Showing with 36 additions and 0 deletions.
  1. +27 −0 test/cb.js
  2. +9 −0 test/sources/cb.js
View
27 test/cb.js
@@ -0,0 +1,27 @@
+var stackedy = require('../');
+var test = require('tap').test;
+
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/sources/cb.js', 'utf8');
+
+test('cb', function (t) {
+ t.plan(5);
+ var stack = stackedy(src).run({
+ fn : function (name, cb) {
+ t.equal(name, 'quoymielle')
+ cb({
+ ok : t.ok.bind(t),
+ equal : t.equal.bind(t),
+ end : t.end.bind(t),
+ wuxxet : function (x, cb) {
+ t.equal(x, 'flibble');
+ cb('kallisti');
+ }
+ });
+ }
+ });
+
+ stack.on('error', function (err, c) {
+ t.fail(err);
+ });
+});
View
9 test/sources/cb.js
@@ -0,0 +1,9 @@
+fn('quoymielle', function (t) {
+ t.ok(true);
+ t.equal(2, 2);
+
+ t.wuxxet('flibble', function (k) {
+ t.equal(k, 'kallisti');
+ t.end();
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.