Permalink
Browse files

single test using tap

  • Loading branch information...
1 parent b2e69af commit 06ef6b871aba8511d8a0bdb052397b9fece47689 @substack committed Nov 3, 2011
Showing with 8 additions and 7 deletions.
  1. +8 −7 test/single.js
View
@@ -1,13 +1,13 @@
var dnode = require('../')
-var util = require('util');
-var assert = require('assert');
+var test = require('tap').test;
-exports.simple = function () {
+test('simple', function (t) {
+ t.plan(3);
var port = Math.floor(Math.random() * 40000 + 10000);
var server = dnode({
timesTen : function (n,reply) {
- assert.equal(n.number, 5);
+ t.equal(n.number, 5);
reply(n.number * 10);
},
print : function (n,reply) {
@@ -17,17 +17,18 @@ exports.simple = function () {
server.on('ready', function () {
dnode.connect(port, function (remote, conn) {
- assert.equal(conn.stream.remoteAddress, '127.0.0.1');
+ t.equal(conn.stream.remoteAddress, '127.0.0.1');
var args = {
number : 5,
func : function () {},
};
remote.timesTen(args, function (m) {
- assert.equal(m, 50, '5 * 10 == 50');
+ t.equal(m, 50, '5 * 10 == 50');
conn.end();
server.close();
+ t.end();
});
});
});
-};
+});

0 comments on commit 06ef6b8

Please sign in to comment.