From f7b6499f6b7fcbca02c1093614b3617e6aa75732 Mon Sep 17 00:00:00 2001 From: maxired Date: Thu, 20 Feb 2014 20:29:41 +0100 Subject: [PATCH] add test for port binding --- test/end-to-end.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/end-to-end.js b/test/end-to-end.js index 4ee8670a..3306495b 100644 --- a/test/end-to-end.js +++ b/test/end-to-end.js @@ -265,4 +265,20 @@ describe('end-to-end', function() { }) }) }) + + it("should use the port binded in the agent", function(done){ + var agent = new coap.Agent({port: 3636}) + , req = coap.request({ + port:port + , method:'GET' + , pathname :'a' + , agent:agent + }).end() + + server.on('request', function(req, res){ + res.end('hello'); + expect(req.rsinfo.port).eql(3636); + done(); + }); + }); })