Skip to content

Commit

Permalink
add test for port binding
Browse files Browse the repository at this point in the history
  • Loading branch information
maxired committed Feb 20, 2014
1 parent daf88a3 commit f7b6499
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/end-to-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
})

0 comments on commit f7b6499

Please sign in to comment.