Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bidirectional test now using tap

  • Loading branch information...
commit aee1992882f3055917c3b95bde698577b658c83a 1 parent fb56c46
@substack authored
Showing with 11 additions and 10 deletions.
  1. +1 −1  package.json
  2. +10 −9 test/bidirectional.js
View
2  package.json
@@ -29,7 +29,7 @@
"jsonify" : "0.0.x"
},
"devDependencies" : {
- "expresso" : "0.7.x",
+ "tap" : "0.0.x",
"browserify" : "1.4.x",
"uglify-js" : "1.0.6"
},
View
19 test/bidirectional.js
@@ -1,17 +1,17 @@
var dnode = require('../');
-var assert = require('assert');
+var test = require('tap').test;
-exports['bidirectional'] = function () {
+test('bidirectional', function (t) {
+ t.plan(5);
var port = Math.floor(Math.random() * 40000 + 10000);
-
var counts = { timesX : 0, clientX : 0, x : 0 };
var server = dnode(function (client) {
this.timesX = function (n,f) {
- assert.equal(n, 3, "timesX's n == 3");
+ t.equal(n, 3, "timesX's n == 3");
counts.timesX ++;
client.x(function (x) {
- assert.equal(x, 20, 'client.x == 20');
+ t.equal(x, 20, 'client.x == 20');
counts.clientX ++;
f(n * x);
});
@@ -26,7 +26,7 @@ exports['bidirectional'] = function () {
}
}).connect(port, function (remote, conn) {
remote.timesX(3, function (res) {
- assert.equal(res, 60, 'result of 20 * 3 == 60');
+ t.equal(res, 60, 'result of 20 * 3 == 60');
conn.end();
server.close();
});
@@ -34,7 +34,8 @@ exports['bidirectional'] = function () {
});
server.once('close', function () {
- assert.equal(counts.timesX, 1, 'timesX called once');
- assert.equal(counts.clientX, 1, 'clientX called once');
+ t.equal(counts.timesX, 1, 'timesX called once');
+ t.equal(counts.clientX, 1, 'clientX called once');
+ t.end();
});
-};
+});
Please sign in to comment.
Something went wrong with that request. Please try again.