Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update http agent mock to node 5+
  • Loading branch information
yciabaud committed Aug 25, 2016
commit f358ed87ec85df864980b6c2ee40b52c9bbed262
5 changes: 3 additions & 2 deletions test/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var Client = require('../')
var common = require('./common')
var fixtures = require('webtorrent-fixtures')
var http = require('http')
var net = require('net')
var test = require('tape')

var peerId1 = Buffer.from('01234567890123456789')
Expand Down Expand Up @@ -388,9 +389,9 @@ function testClientStartHttpAgent (t, serverType) {
common.createServer(t, serverType, function (server, announceUrl) {
var agent = new http.Agent()
var agentUsed = false
agent.createSocket = function (req, options) {
agent.createConnection = function (opts, fn) {
agentUsed = true
return http.Agent.prototype.createSocket.call(this, req, options)
return net.createConnection(opts, fn)
}
var client = new Client({
infoHash: fixtures.leaves.parsedTorrent.infoHash,
Expand Down