Permalink
Browse files

all tests pass again with tap

  • Loading branch information...
substack committed Jan 21, 2012
1 parent 1c25f98 commit 82897871394444c7b1c256e93d53e7ba516f3d29
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/proto.js
View
@@ -7,8 +7,8 @@ test('proto hashes', function (t) {
var server = proto({
x : function (f, g) {
- setTimeout(f.bind({}, 7, 8, 9), 50);
- setTimeout(g.bind({}, [ 'q', 'r' ]), 100);
+ setTimeout(f.bind({}, 7, 8, 9), 25);
+ setTimeout(g.bind({}, [ 'q', 'r' ]), 50);
},
y : 555
});
@@ -48,12 +48,15 @@ test('proto hashes', function (t) {
links : [],
} ]);
+ var pending = 2;
c.request('x', [
function (x, y , z) {
t.deepEqual([ x, y, z ], [ 7, 8, 9 ]);
+ if (--pending === 0) t.end();
},
function (qr) {
t.deepEqual(qr, [ 'q', 'r' ]);
+ if (--pending === 0) t.end();
}
]);
@@ -68,7 +71,6 @@ test('proto hashes', function (t) {
t.ok(err.stack);
t.ok(err.message.match(/^Error parsing JSON/));
t.ok(err instanceof SyntaxError);
- t.end();
});
c.parse('{');
});

0 comments on commit 8289787

Please sign in to comment.