Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

undici

Package Overview
Dependencies
Maintainers
2
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undici - npm Package Compare versions

Comparing version 3.3.4 to 3.3.5

12

lib/core/client.js

@@ -366,3 +366,3 @@ 'use strict'

)
} else if (nodeMajorVersion > 12) {
} else if (nodeMajorVersion > 12 && nodeMajorVersion < 16) {
super()

@@ -376,4 +376,12 @@ this.initialize(

)
} else if (nodeMajorVersion >= 16) {
super()
this.initialize(
HTTPParser.RESPONSE,
{},
client[kMaxHeadersSize],
0
)
} else {
super(HTTPParser.RESPONSE, false)
super(HTTPParser.RESPONSE)
}

@@ -380,0 +388,0 @@

4

package.json
{
"name": "undici",
"version": "3.3.4",
"version": "3.3.5",
"description": "An HTTP/1.1 client, written from scratch for Node.js",

@@ -45,3 +45,3 @@ "main": "index.js",

"standard": "^14.3.4",
"tap": "^14.10.8",
"tap": "^15.0.0",
"tsd": "^0.13.1"

@@ -48,0 +48,0 @@ },

@@ -67,3 +67,3 @@ 'use strict'

response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -70,0 +70,0 @@ })

@@ -36,3 +36,3 @@ 'use strict'

response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -39,0 +39,0 @@ })

@@ -18,3 +18,3 @@ 'use strict'

t.plan(1)
t.throw(() => setGlobalAgent({ get: 'not a function' }), InvalidArgumentError)
t.throws(() => setGlobalAgent({ get: 'not a function' }), InvalidArgumentError)
})

@@ -24,7 +24,7 @@

t.plan(2)
t.notThrow(() => setGlobalAgent(new Agent()))
t.notThrow(() => setGlobalAgent({ get: () => {} }))
t.doesNotThrow(() => setGlobalAgent(new Agent()))
t.doesNotThrow(() => setGlobalAgent({ get: () => {} }))
})
t.tearDown(() => {
t.teardown(() => {
// reset globalAgent to a fresh Agent instance for later tests

@@ -38,6 +38,6 @@ setGlobalAgent(new Agent())

t.notThrow(() => new Agent())
t.notThrow(() => new Agent({ connections: 5 }))
t.throw(() => new Agent().get(), InvalidArgumentError)
t.throw(() => new Agent().get(''), InvalidArgumentError)
t.doesNotThrow(() => new Agent())
t.doesNotThrow(() => new Agent({ connections: 5 }))
t.throws(() => new Agent().get(), InvalidArgumentError)
t.throws(() => new Agent().get(''), InvalidArgumentError)
})

@@ -58,3 +58,3 @@

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -98,3 +98,3 @@ server.listen(0, () => {

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -138,5 +138,5 @@ server.listen(0, () => {

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -146,3 +146,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -152,4 +152,4 @@ server.listen(0, () => {

.then(({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -160,3 +160,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -175,5 +175,5 @@ })

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -183,3 +183,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -191,4 +191,4 @@ const agent = new Agent()

.then(({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -199,3 +199,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -211,6 +211,6 @@ })

t.plan(4)
t.throw(() => request(), InvalidArgumentError, 'throws on missing url argument')
t.throw(() => request(''), TypeError, 'throws on invalid url')
t.throw(() => request({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throw(() => request({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
t.throws(() => request(), InvalidArgumentError, 'throws on missing url argument')
t.throws(() => request(''), TypeError, 'throws on invalid url')
t.throws(() => request({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throws(() => request({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
})

@@ -220,5 +220,5 @@

t.plan(3)
t.throw(() => request('https://example.com', { path: 'asd' }), InvalidArgumentError, 'throws on opts.path argument')
t.throw(() => request('https://example.com', { path: '' }), InvalidArgumentError, 'throws on opts.path argument')
t.throw(() => request('https://example.com', { path: 0 }), InvalidArgumentError, 'throws on opts.path argument')
t.throws(() => request('https://example.com', { path: 'asd' }), InvalidArgumentError, 'throws on opts.path argument')
t.throws(() => request('https://example.com', { path: '' }), InvalidArgumentError, 'throws on opts.path argument')
t.throws(() => request('https://example.com', { path: 0 }), InvalidArgumentError, 'throws on opts.path argument')
})

@@ -231,3 +231,3 @@

}
t.throw(() => request('https://example.com', { agent }), InvalidReturnValueError)
t.throws(() => request('https://example.com', { agent }), InvalidReturnValueError)
})

@@ -244,5 +244,5 @@ })

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -252,3 +252,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -262,4 +262,4 @@ server.listen(0, () => {

({ statusCode, headers, opaque: pt }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -270,3 +270,3 @@ pt.on('data', (buf) => {

pt.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -287,5 +287,5 @@ pt.on('error', () => {

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -295,3 +295,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -308,4 +308,4 @@ const agent = new Agent()

({ statusCode, headers, opaque: pt }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -316,3 +316,3 @@ pt.on('data', (buf) => {

pt.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -330,6 +330,6 @@ pt.on('error', () => {

t.plan(4)
t.throw(() => stream(), InvalidArgumentError, 'throws on missing url argument')
t.throw(() => stream(''), TypeError, 'throws on invalid url')
t.throw(() => stream({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throw(() => stream({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
t.throws(() => stream(), InvalidArgumentError, 'throws on missing url argument')
t.throws(() => stream(''), TypeError, 'throws on invalid url')
t.throws(() => stream({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throws(() => stream({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
})

@@ -342,3 +342,3 @@

}
t.throw(() => stream('https://example.com', { agent }), InvalidReturnValueError)
t.throws(() => stream('https://example.com', { agent }), InvalidReturnValueError)
})

@@ -355,5 +355,5 @@ })

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -363,3 +363,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -373,4 +373,4 @@ server.listen(0, () => {

({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
return body

@@ -384,3 +384,3 @@ }

.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -398,5 +398,5 @@ .on('error', () => {

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('Content-Type', 'text/plain')

@@ -406,3 +406,3 @@ res.end(wanted)

t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -418,4 +418,4 @@ const agent = new Agent()

({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
return body

@@ -429,3 +429,3 @@ }

.on('end', () => {
t.strictEqual(wanted, Buffer.concat(bufs).toString('utf8'))
t.equal(wanted, Buffer.concat(bufs).toString('utf8'))
})

@@ -440,6 +440,6 @@ .on('error', () => {

t.plan(4)
t.throw(() => pipeline(), InvalidArgumentError, 'throws on missing url argument')
t.throw(() => pipeline(''), TypeError, 'throws on invalid url')
t.throw(() => pipeline({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throw(() => pipeline({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
t.throws(() => pipeline(), InvalidArgumentError, 'throws on missing url argument')
t.throws(() => pipeline(''), TypeError, 'throws on invalid url')
t.throws(() => pipeline({}), InvalidArgumentError, 'throws on missing url.origin argument')
t.throws(() => pipeline({ origin: '' }), InvalidArgumentError, 'throws on invalid url.origin argument')
})

@@ -452,5 +452,5 @@

}
t.throw(() => pipeline('https://example.com', { agent }), InvalidReturnValueError)
t.throws(() => pipeline('https://example.com', { agent }), InvalidReturnValueError)
})
})
})

@@ -52,7 +52,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -62,3 +62,3 @@ client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {

body.resume()
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)

@@ -69,3 +69,3 @@ setCurrentTransaction({ hello: 'world2' })

t.error(err)
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world2' })
t.strictSame(getCurrentTransaction(), { hello: 'world2' })

@@ -86,3 +86,3 @@ body.once('data', () => {

body.resume()
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)

@@ -93,3 +93,3 @@ setCurrentTransaction({ hello: 'world' })

t.error(err)
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world' })
t.strictSame(getCurrentTransaction(), { hello: 'world' })

@@ -110,3 +110,3 @@ body.once('data', () => {

body.resume()
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)

@@ -117,3 +117,3 @@ setCurrentTransaction({ hello: 'world' })

t.error(err)
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world' })
t.strictSame(getCurrentTransaction(), { hello: 'world' })

@@ -132,7 +132,7 @@ body.once('data', () => {

client.stream({ path: '/', method: 'GET' }, () => {
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)
return new PassThrough().resume()
}, (err) => {
t.error(err)
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)

@@ -142,7 +142,7 @@ setCurrentTransaction({ hello: 'world' })

client.stream({ path: '/', method: 'GET' }, () => {
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world' })
t.strictSame(getCurrentTransaction(), { hello: 'world' })
return new PassThrough().resume()
}, (err) => {
t.error(err)
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world' })
t.strictSame(getCurrentTransaction(), { hello: 'world' })
})

@@ -163,7 +163,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -176,3 +176,3 @@ client.request({ path: '/', method: 'GET' }, (err, { body }) => {

})
t.strictDeepEqual(getCurrentTransaction(), null)
t.strictSame(getCurrentTransaction(), null)

@@ -182,4 +182,4 @@ setCurrentTransaction({ hello: 'world2' })

client.request({ path: '/', method: 'GET' }, (err) => {
t.strictEqual(err.message, 'The client is destroyed')
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world2' })
t.equal(err.message, 'The client is destroyed')
t.strictSame(getCurrentTransaction(), { hello: 'world2' })
})

@@ -199,7 +199,7 @@ client.destroy((err) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -210,3 +210,3 @@ setCurrentTransaction({ hello: 'world2' })

.pipeline({ path: '/', method: 'GET' }, ({ body }) => {
t.strictDeepEqual(getCurrentTransaction(), { hello: 'world2' })
t.strictSame(getCurrentTransaction(), { hello: 'world2' })
return body

@@ -213,0 +213,0 @@ })

@@ -17,7 +17,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -44,7 +44,7 @@ client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -51,0 +51,0 @@ client.request({

@@ -26,7 +26,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -38,5 +38,5 @@ const signal = new EE()

})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
const { socket } = await promise
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)

@@ -49,3 +49,3 @@ let recvData = ''

socket.on('end', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})

@@ -76,7 +76,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -86,3 +86,3 @@ const { statusCode, socket } = await client.connect({

})
t.strictEqual(statusCode, 300)
t.equal(statusCode, 300)
socket.destroy()

@@ -101,7 +101,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -143,3 +143,3 @@ try {

server.on('connect', (req, socket, firstBodyChunk) => {
t.strictEqual(canConnect, true)
t.equal(canConnect, true)
socket.write('HTTP/1.1 200 Connection established\r\n\r\n')

@@ -156,3 +156,3 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -163,3 +163,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -174,3 +174,3 @@ client.request({

process.nextTick(() => {
t.strictEqual(client.busy, false)
t.equal(client.busy, false)

@@ -187,3 +187,3 @@ client.connect({

socket.on('end', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})

@@ -194,3 +194,3 @@

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)

@@ -217,3 +217,3 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -224,3 +224,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -237,8 +237,8 @@ client.on('disconnect', () => {

}, (err, { opaque }) => {
t.strictEqual(opaque, 'asd')
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(opaque, 'asd')
t.equal(signal.listenerCount('abort'), 0)
t.ok(err instanceof errors.RequestAbortedError)
})
t.strictEqual(client.busy, true)
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(client.busy, true)
t.equal(signal.listenerCount('abort'), 1)
signal.emit('abort')

@@ -270,7 +270,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -283,3 +283,3 @@ const _err = new Error()

socket.on('error', (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -300,7 +300,7 @@ throw _err

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -316,3 +316,3 @@ client.on('disconnect', () => {

}, (err, { opaque }) => {
t.strictEqual(opaque, 'asd')
t.equal(opaque, 'asd')
t.ok(err instanceof errors.InvalidArgumentError)

@@ -333,3 +333,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -340,3 +340,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -352,7 +352,7 @@ client.on('disconnect', () => {

}, (err, { opaque }) => {
t.strictEqual(opaque, 'asd')
t.equal(opaque, 'asd')
t.ok(err instanceof errors.RequestAbortedError)
})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
})
})

@@ -48,12 +48,12 @@ 'use strict'

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.strictEqual(undefined, req.headers.foo)
t.strictEqual('bar', req.headers.bar)
t.strictEqual('null', req.headers.baz)
t.strictEqual(undefined, req.headers['content-length'])
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
t.equal(undefined, req.headers.foo)
t.equal('bar', req.headers.bar)
t.equal('null', req.headers.baz)
t.equal(undefined, req.headers['content-length'])
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -68,3 +68,3 @@ const reqHeaders = {

const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -80,4 +80,4 @@ const bufs = []

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.strictEqual(Array.isArray(headers), true)
t.equal(statusCode, 200)
t.equal(Array.isArray(headers), true)
},

@@ -88,4 +88,4 @@ onData (buf) {

onComplete (trailers) {
t.strictEqual(trailers, null)
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal(trailers, null)
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
},

@@ -103,8 +103,8 @@ onError () {

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.strictEqual(undefined, req.headers.foo)
t.strictEqual('bar', req.headers.bar)
t.strictEqual(undefined, req.headers['content-length'])
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
t.equal(undefined, req.headers.foo)
t.equal('bar', req.headers.bar)
t.equal(undefined, req.headers['content-length'])
res.addTrailers({ 'Content-MD5': 'test' })

@@ -115,3 +115,3 @@ res.setHeader('Content-Type', 'text/plain')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -125,3 +125,3 @@ const reqHeaders = {

const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -137,7 +137,7 @@ const bufs = []

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.strictEqual(Array.isArray(headers), true)
t.equal(statusCode, 200)
t.equal(Array.isArray(headers), true)
{
const contentTypeIdx = headers.findIndex(x => x === 'Content-Type')
t.strictEqual(headers[contentTypeIdx + 1], 'text/plain')
t.equal(headers[contentTypeIdx + 1], 'text/plain')
}

@@ -149,8 +149,8 @@ },

onComplete (trailers) {
t.strictEqual(Array.isArray(trailers), true)
t.equal(Array.isArray(trailers), true)
{
const contentMD5Idx = trailers.findIndex(x => x === 'Content-MD5')
t.strictEqual(trailers[contentMD5Idx + 1], 'test')
t.equal(trailers[contentMD5Idx + 1], 'test')
}
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
},

@@ -170,7 +170,7 @@ onError () {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -194,3 +194,3 @@ const _err = new Error()

onError (err) {
t.strictEqual(err, _err)
t.equal(err, _err)
}

@@ -207,7 +207,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -231,3 +231,3 @@ const _err = new Error()

onError (err) {
t.strictEqual(err, _err)
t.equal(err, _err)
}

@@ -244,7 +244,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -268,3 +268,3 @@ const _err = new Error()

onError (err) {
t.strictEqual(err, _err)
t.equal(err, _err)
}

@@ -281,7 +281,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -306,3 +306,3 @@ const _err = new Error()

onError (err) {
t.strictEqual(err, _err)
t.equal(err, _err)
}

@@ -331,7 +331,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -350,3 +350,3 @@ let recvData = ''

onUpgrade (statusCode, headers, socket) {
t.strictEqual(count++, 0)
t.equal(count++, 0)

@@ -358,3 +358,3 @@ socket.on('data', (d) => {

socket.on('end', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})

@@ -384,7 +384,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -405,3 +405,3 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -418,7 +418,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -438,3 +438,3 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -451,7 +451,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -471,3 +471,3 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -484,7 +484,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -504,3 +504,3 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -517,7 +517,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -542,3 +542,3 @@ try {

} catch (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -554,7 +554,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -571,4 +571,4 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(err.message, 'invalid onUpgrade method')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.message, 'invalid onUpgrade method')
}

@@ -585,7 +585,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -602,4 +602,4 @@ client.dispatch({

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(err.message, 'invalid onUpgrade method')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.message, 'invalid onUpgrade method')
}

@@ -616,7 +616,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -631,4 +631,4 @@ try {

} catch (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(err.message, 'invalid onError method')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.message, 'invalid onError method')
}

@@ -644,7 +644,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -651,0 +651,0 @@ const stream = new PassThrough()

@@ -21,4 +21,4 @@ 'use strict'

server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')

@@ -28,3 +28,3 @@ res.end('hello')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -35,7 +35,7 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
client.request({ path: '/', method: 'GET', idempotent: false, opaque: 'asd' }, (err, data) => {
t.ok(err instanceof Error) // we are expecting an error
t.strictEqual(data.opaque, 'asd')
t.equal(data.opaque, 'asd')
})

@@ -45,4 +45,4 @@

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -53,3 +53,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -77,4 +77,4 @@ })

} else {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')

@@ -84,3 +84,3 @@ res.end('hello')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -91,3 +91,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -98,3 +98,3 @@ // all of these will error

t.ok(err instanceof Error) // we are expecting an error
t.strictEqual(data.opaque, 'asd')
t.equal(data.opaque, 'asd')
})

@@ -106,4 +106,4 @@ }

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -114,3 +114,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -126,5 +126,5 @@ })

server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('POST', req.method)
t.strictEqual('42', req.headers['content-length'])
t.equal('/', req.url)
t.equal('POST', req.method)
t.equal('42', req.headers['content-length'])

@@ -139,8 +139,8 @@ const bufs = []

// but this will still end
t.strictEqual('a string', Buffer.concat(bufs).toString('utf8'))
t.equal('a string', Buffer.concat(bufs).toString('utf8'))
})
server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')

@@ -150,7 +150,7 @@ res.end('hello')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -172,4 +172,4 @@ client.request({

}, (err, data) => {
t.strictEqual(err.message, 'kaboom')
t.strictEqual(data.opaque, 'asd')
t.equal(err.message, 'kaboom')
t.equal(data.opaque, 'asd')
})

@@ -180,4 +180,4 @@

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -188,3 +188,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -200,5 +200,5 @@ })

server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('POST', req.method)
t.strictEqual(req.headers['content-length'], undefined)
t.equal('/', req.url)
t.equal('POST', req.method)
t.equal(req.headers['content-length'], undefined)

@@ -213,8 +213,8 @@ const bufs = []

// but this will still end
t.strictEqual('a string', Buffer.concat(bufs).toString('utf8'))
t.equal('a string', Buffer.concat(bufs).toString('utf8'))
})
server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')

@@ -224,7 +224,7 @@ res.end('hello')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -242,4 +242,4 @@ client.request({

}, (err, data) => {
t.strictEqual(err.message, 'kaboom')
t.strictEqual(data.opaque, 'asd')
t.equal(err.message, 'kaboom')
t.equal(data.opaque, 'asd')
})

@@ -250,4 +250,4 @@

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -258,3 +258,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -271,3 +271,3 @@ })

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid port')
t.equal(err.message, 'invalid port')
}

@@ -280,3 +280,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid url')
t.equal(err.message, 'invalid url')
}

@@ -289,3 +289,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid url')
t.equal(err.message, 'invalid url')
}

@@ -298,3 +298,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid url')
t.equal(err.message, 'invalid url')
}

@@ -309,3 +309,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid socketPath')
t.equal(err.message, 'invalid socketPath')
}

@@ -320,3 +320,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid keepAliveTimeout')
t.equal(err.message, 'invalid keepAliveTimeout')
}

@@ -331,3 +331,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid keepAliveMaxTimeout')
t.equal(err.message, 'invalid keepAliveMaxTimeout')
}

@@ -342,3 +342,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid keepAliveMaxTimeout')
t.equal(err.message, 'invalid keepAliveMaxTimeout')
}

@@ -353,3 +353,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid keepAliveTimeoutThreshold')
t.equal(err.message, 'invalid keepAliveTimeoutThreshold')
}

@@ -364,3 +364,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid protocol')
t.equal(err.message, 'invalid protocol')
}

@@ -375,3 +375,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid hostname')
t.equal(err.message, 'invalid hostname')
}

@@ -386,3 +386,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid maxHeaderSize')
t.equal(err.message, 'invalid maxHeaderSize')
}

@@ -395,3 +395,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid url')
t.equal(err.message, 'invalid url')
}

@@ -405,3 +405,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid callback')
t.equal(err.message, 'invalid callback')
}

@@ -415,3 +415,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid callback')
t.equal(err.message, 'invalid callback')
}

@@ -424,3 +424,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
t.equal(err.message, 'unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
}

@@ -433,3 +433,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'unsupported keepAlive, use pipelining=0 instead')
t.equal(err.message, 'unsupported keepAlive, use pipelining=0 instead')
}

@@ -442,3 +442,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'unsupported idleTimeout, use keepAliveTimeout instead')
t.equal(err.message, 'unsupported idleTimeout, use keepAliveTimeout instead')
}

@@ -451,3 +451,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
t.equal(err.message, 'unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
}

@@ -467,7 +467,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -534,7 +534,7 @@ function checkError (err) {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -544,3 +544,3 @@ const body = new Readable({ read () {} })

body.on('error', (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -553,3 +553,3 @@

}, (err, data) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -569,7 +569,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -592,7 +592,7 @@ client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -659,7 +659,7 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -681,7 +681,7 @@ client.request({ path: '/', method: 'GET' }, (err) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -717,3 +717,3 @@ const body = new Readable({ read () {} })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -724,3 +724,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -740,3 +740,3 @@ const _err = new Error('kaboom')

}, (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -759,3 +759,3 @@ client.close((err) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -766,3 +766,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -798,3 +798,3 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -805,3 +805,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -820,3 +820,3 @@ let requestErrored = false

t.error(err)
t.strictEqual(requestErrored, true)
t.equal(requestErrored, true)
})

@@ -831,3 +831,3 @@ })

t.ok(err)
t.strictEqual(data.opaque, 'asd')
t.equal(data.opaque, 'asd')
})

@@ -844,3 +844,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -851,3 +851,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -933,7 +933,7 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -953,3 +953,3 @@ client.request({

t.ok(err)
t.strictDeepEqual(ticked, true)
t.strictSame(ticked, true)
})

@@ -971,4 +971,4 @@ ticked = true

client.request({ path: '/', method: 'GET', signal: {}, opaque: 'asd' }, (err, { opaque }) => {
t.strictEqual(ticked, true)
t.strictEqual(opaque, 'asd')
t.equal(ticked, true)
t.equal(opaque, 'asd')
t.ok(err instanceof errors.InvalidArgumentError)

@@ -978,8 +978,8 @@ })

.on('error', (err) => {
t.strictEqual(ticked, true)
t.equal(ticked, true)
t.ok(err instanceof errors.InvalidArgumentError)
})
client.stream({ path: '/', method: 'GET', signal: {}, opaque: 'asd' }, () => {}, (err, { opaque }) => {
t.strictEqual(ticked, true)
t.strictEqual(opaque, 'asd')
t.equal(ticked, true)
t.equal(opaque, 'asd')
t.ok(err instanceof errors.InvalidArgumentError)

@@ -997,7 +997,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1014,3 +1014,3 @@ client.request({

}, (err) => {
t.strictEqual(err.code, 'ERR_INVALID_ARG_TYPE')
t.equal(err.code, 'ERR_INVALID_ARG_TYPE')
})

@@ -1023,3 +1023,3 @@ })

const client = new Client('http://localhost:5554')
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1026,0 +1026,0 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

@@ -16,7 +16,7 @@ 'use strict'

}).on('end', () => {
t.strictDeepEqual(buf, body)
t.strictSame(buf, body)
res.end()
})
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -27,3 +27,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -41,3 +41,3 @@ const _err = new Error()

}, (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -44,0 +44,0 @@ }

@@ -322,3 +322,3 @@ 'use strict'

const server = http.createServer((req, res) => {
t.false(ports.includes(req.socket.remotePort))
t.notOk(ports.includes(req.socket.remotePort))
ports.push(req.socket.remotePort)

@@ -325,0 +325,0 @@ t.match(req.headers, { connection: 'close' })

@@ -19,14 +19,14 @@ 'use strict'

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.strictEqual(undefined, req.headers['content-length'])
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
t.equal(undefined, req.headers['content-length'])
res.setHeader('Content-Type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -37,5 +37,5 @@ {

client.pipeline({ signal, path: '/', method: 'GET' }, ({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
t.equal(signal.listenerCount('abort'), 1)
return body

@@ -48,8 +48,8 @@ })

.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
.on('close', () => {
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)
})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
}

@@ -60,4 +60,4 @@

client.pipeline({ path: '/', method: 'GET' }, ({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
return body

@@ -70,3 +70,3 @@ })

.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -83,7 +83,7 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -113,3 +113,3 @@ let res = ''

final (callback) {
t.strictEqual(res, buf1 + buf2)
t.equal(res, buf1 + buf2)
callback()

@@ -134,7 +134,7 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -164,3 +164,3 @@ let res = ''

final (callback) {
t.strictEqual(res, 'asd')
t.equal(res, 'asd')
callback()

@@ -191,3 +191,3 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -198,3 +198,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -206,3 +206,3 @@ const dup = client.pipeline({

body.on('error', (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -213,3 +213,3 @@ dup.destroy(new Error('asd'))

.on('error', (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -229,7 +229,7 @@ .on('close', () => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -270,7 +270,7 @@ const buf = Buffer.alloc(1e6).toString()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -311,7 +311,7 @@ const buf = Buffer.alloc(1e6).toString()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -345,7 +345,7 @@ const buf = Buffer.alloc(1e6).toString()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -385,7 +385,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -401,3 +401,3 @@ client.pipeline({

.on('error', (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -414,7 +414,7 @@ .end()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -448,7 +448,7 @@ const dup = client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -485,7 +485,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -511,7 +511,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -547,7 +547,7 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -569,3 +569,3 @@ client.pipeline({

} else {
t.strictEqual(err.code, 'UND_ERR_ABORTED')
t.equal(err.code, 'UND_ERR_ABORTED')
}

@@ -583,7 +583,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -617,7 +617,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -630,3 +630,3 @@ client.pipeline({

body.on('error', (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -640,3 +640,3 @@ setImmediate(() => {

.on('error', (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -655,7 +655,7 @@ .end()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -684,7 +684,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -714,7 +714,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -742,3 +742,3 @@ client.pipeline({ path: '/', method: 'GET' }, ({ body }) => {

}).on('end', () => {
t.strictEqual('asd', buf)
t.equal('asd', buf)
})

@@ -768,7 +768,7 @@ return body

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -794,7 +794,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -822,7 +822,7 @@ client

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -849,7 +849,7 @@ client

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -866,3 +866,3 @@ client

.on('data', data => {
t.strictDeepEqual(data, { asd: 1 })
t.strictSame(data, { asd: 1 })
})

@@ -879,7 +879,7 @@ .end()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -905,7 +905,7 @@ client.close((err) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -932,7 +932,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -962,7 +962,7 @@ client.pipeline({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -978,3 +978,3 @@ let buf = ''

.on('end', () => {
t.strictEqual(buf, 'hello')
t.equal(buf, 'hello')
})

@@ -994,7 +994,7 @@ .end()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -1019,3 +1019,3 @@ let buf = ''

.on('end', () => {
t.strictEqual(buf, expected)
t.equal(buf, expected)
})

@@ -1035,7 +1035,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1042,0 +1042,0 @@ const signal = new EE()

@@ -23,7 +23,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
// needed to check for a warning on the maxListeners on the socket
process.on('warning', t.fail)
t.tearDown(() => {
t.teardown(() => {
process.removeListener('warning', t.fail)

@@ -36,3 +36,3 @@ })

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -59,3 +59,3 @@ for (var i = 0; i < num; i++) {

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -66,3 +66,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('/' + i, Buffer.concat(bufs).toString('utf8'))
t.equal('/' + i, Buffer.concat(bufs).toString('utf8'))
})

@@ -88,3 +88,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -95,3 +95,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -138,3 +138,3 @@ for (; sent < 2;) {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -145,3 +145,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
client.request({

@@ -151,3 +151,3 @@ path: '/',

}, (err, data) => {
t.strictEqual(client.size, 1)
t.equal(client.size, 1)
t.error(err)

@@ -173,3 +173,3 @@ t.notOk(client.request({

t.ok(client.busy)
t.strictEqual(client.size, 1)
t.equal(client.size, 1)
})

@@ -193,3 +193,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -200,3 +200,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -256,3 +256,3 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -263,3 +263,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -289,3 +289,3 @@ client.request({

t.ok(err)
t.strictEqual(data.opaque, 'asd')
t.equal(data.opaque, 'asd')
})

@@ -313,3 +313,3 @@ client.close((err) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -320,3 +320,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -343,3 +343,3 @@ let ended = false

t.error(err)
t.strictEqual(ended, true)
t.equal(ended, true)
data.body.resume()

@@ -359,3 +359,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -366,3 +366,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -402,3 +402,3 @@ let ended = false

t.error(err)
t.strictEqual(ended, true)
t.equal(ended, true)
data.body.resume()

@@ -416,3 +416,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -423,3 +423,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -429,3 +429,3 @@ client[kConnect](() => {

client.once('disconnect', () => {
t.strictEqual(ended, true)
t.equal(ended, true)
})

@@ -450,3 +450,3 @@

body.push(null)
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -472,3 +472,3 @@

body.push(null)
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -493,3 +493,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -500,3 +500,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -506,3 +506,3 @@ client[kConnect](() => {

client.once('disconnect', () => {
t.strictEqual(ended, true)
t.equal(ended, true)
})

@@ -526,3 +526,3 @@

})
t.strictEqual(client.busy, false)
t.equal(client.busy, false)

@@ -542,4 +542,4 @@ client.request({

})
t.strictEqual(client.busy, true)
t.strictEqual(client.running, 2)
t.equal(client.busy, true)
t.equal(client.running, 2)
})

@@ -556,3 +556,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -563,3 +563,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -583,3 +583,3 @@ {

body.push(null)
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -605,3 +605,3 @@

body.push(null)
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -622,5 +622,5 @@

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
signal.emit('abort')
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -646,3 +646,3 @@

body.push(null)
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
}

@@ -649,0 +649,0 @@ })

@@ -18,11 +18,11 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
client.request({ path: '/', method: 'GET' }, (err, data) => {
t.ok(err)
t.is(err.code, 'UND_ERR_SOCKET')
t.equal(err.code, 'UND_ERR_SOCKET')
})

@@ -29,0 +29,0 @@

@@ -18,7 +18,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -32,5 +32,5 @@ client[kConnect](() => {

t.ok(err instanceof errors.RequestAbortedError)
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)
})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)

@@ -43,5 +43,5 @@ client.request({

t.ok(err instanceof errors.RequestAbortedError)
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
})
t.strictEqual(signal.listenerCount('abort'), 2)
t.equal(signal.listenerCount('abort'), 2)
})

@@ -56,7 +56,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -73,3 +73,3 @@ const body = new Readable({

} catch (err) {
t.strictEqual(body.destroyed, true)
t.equal(body.destroyed, true)
}

@@ -87,7 +87,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -99,3 +99,3 @@ const { body, trailers } = await client.request({

t.strictDeepEqual(trailers, {})
t.strictSame(trailers, {})

@@ -105,5 +105,5 @@ body

.on('end', () => {
t.strictDeepEqual(trailers, { 'content-md5': 'test' })
t.strictSame(trailers, { 'content-md5': 'test' })
})
})
})

@@ -13,13 +13,13 @@ 'use strict'

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -33,4 +33,4 @@ const signal = new EE()

}, ({ statusCode, headers, opaque: pt }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -41,10 +41,10 @@ pt.on('data', (buf) => {

pt.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
return pt
}, (err) => {
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)
t.error(err)
})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
})

@@ -57,13 +57,13 @@ })

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -75,4 +75,4 @@ await client.stream({

}, ({ statusCode, headers, opaque: pt }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -83,3 +83,3 @@ pt.on('data', (buf) => {

pt.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -95,13 +95,13 @@ return pt

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -112,4 +112,4 @@ client.stream({

}, ({ statusCode, headers }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')

@@ -133,4 +133,4 @@ const pt = new PassThrough()

}, ({ statusCode, headers }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')

@@ -142,3 +142,3 @@ let ret = ''

}).on('end', () => {
t.strictEqual(ret, 'hello')
t.equal(ret, 'hello')
})

@@ -162,7 +162,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -207,7 +207,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -222,3 +222,3 @@ const pt = new PassThrough()

}).once('error', (err) => {
t.strictEqual(err.message, 'kaboom')
t.equal(err.message, 'kaboom')
})

@@ -228,3 +228,3 @@ return pt

t.ok(err)
t.strictEqual(pt.destroyed, true)
t.equal(pt.destroyed, true)
})

@@ -259,7 +259,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -272,3 +272,3 @@ const pt = new PassThrough({ autoDestroy: false })

t.error(err)
t.strictEqual(pt.destroyed, false)
t.equal(pt.destroyed, false)
})

@@ -322,3 +322,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -329,3 +329,3 @@ const pt = new PassThrough()

const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -339,3 +339,3 @@ client.stream({

t.error(err)
t.strictEqual(pt.destroyed, true)
t.equal(pt.destroyed, true)
})

@@ -351,7 +351,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -375,7 +375,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -399,7 +399,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -426,7 +426,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -442,6 +442,6 @@ const signal = new EE()

}, (err) => {
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)
t.ok(err instanceof errors.RequestAbortedError)
})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
})

@@ -456,7 +456,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -469,3 +469,3 @@ client.stream({

}, (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -478,3 +478,3 @@ client.stream({

}, (err) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -498,7 +498,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -524,7 +524,7 @@ client.stream({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -555,7 +555,7 @@ const pt = new PassThrough()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -588,7 +588,7 @@ const pt = new PassThrough()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -600,3 +600,3 @@ client.stream({

t.error(err)
t.strictDeepEqual(data.trailers, { 'content-md5': 'test' })
t.strictSame(data.trailers, { 'content-md5': 'test' })
})

@@ -613,7 +613,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -631,3 +631,3 @@ let buf = ''

t.error(err)
t.strictEqual(buf, 'hello')
t.equal(buf, 'hello')
})

@@ -646,7 +646,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -665,3 +665,3 @@ let buf = ''

t.error(err)
t.strictEqual(buf, expected)
t.equal(buf, expected)
})

@@ -676,7 +676,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -693,3 +693,3 @@ const body = new Readable({

} catch (err) {
t.strictEqual(body.destroyed, true)
t.equal(body.destroyed, true)
}

@@ -705,7 +705,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(() => {
t.teardown(() => {
client.destroy()

@@ -735,4 +735,4 @@ })

}, () => {
t.strictEqual(dst._writableState.needDrain, true)
t.strictEqual(dst.writableNeedDrain, true)
t.equal(dst._writableState.needDrain, true)
t.equal(dst.writableNeedDrain, true)

@@ -761,7 +761,7 @@ setImmediate(() => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(() => {
t.teardown(() => {
client.destroy()

@@ -790,4 +790,4 @@ })

}, () => {
t.strictEqual(dst._writableState.needDrain, true)
t.strictEqual(dst.writableNeedDrain, undefined)
t.equal(dst._writableState.needDrain, true)
t.equal(dst.writableNeedDrain, undefined)

@@ -794,0 +794,0 @@ setImmediate(() => {

@@ -27,7 +27,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -43,3 +43,3 @@ const signal = new EE()

t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)

@@ -54,6 +54,6 @@ const { headers, socket } = data

socket.on('close', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})
t.deepEqual(headers, {
t.same(headers, {
hello: 'world',

@@ -65,3 +65,3 @@ connection: 'upgrade',

})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)
})

@@ -87,7 +87,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -106,6 +106,6 @@ const { headers, socket } = await client.upgrade({

socket.on('close', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})
t.deepEqual(headers, {
t.same(headers, {
hello: 'world',

@@ -135,7 +135,7 @@ connection: 'upgrade',

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -183,7 +183,7 @@ try {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -199,3 +199,3 @@ client.upgrade({

t.strictEqual(socket._readableState.flowing, null)
t.equal(socket._readableState.flowing, null)

@@ -208,6 +208,6 @@ let recvData = ''

socket.on('close', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})
t.deepEqual(headers, {
t.same(headers, {
hello: 'world',

@@ -231,3 +231,3 @@ connection: 'upgrade',

server.on('upgrade', (req, c, firstBodyChunk) => {
t.strictEqual(canConnect, true)
t.equal(canConnect, true)
c.write('HTTP/1.1 101\r\n')

@@ -241,3 +241,3 @@ c.write('hello: world\r\n')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -248,3 +248,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -259,3 +259,3 @@ client.request({

process.nextTick(() => {
t.strictEqual(client.busy, false)
t.equal(client.busy, false)

@@ -272,3 +272,3 @@ client.upgrade({

socket.on('end', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})

@@ -279,3 +279,3 @@

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)

@@ -302,3 +302,3 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -309,3 +309,3 @@ server.listen(0, async () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -318,8 +318,8 @@ const signal = new EE()

}, (err, { opaque }) => {
t.strictEqual(opaque, 'asd')
t.equal(opaque, 'asd')
t.ok(err instanceof errors.RequestAbortedError)
t.strictEqual(signal.listenerCount('abort'), 0)
t.equal(signal.listenerCount('abort'), 0)
})
t.strictEqual(client.busy, true)
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(client.busy, true)
t.equal(signal.listenerCount('abort'), 1)
signal.emit('abort')

@@ -351,7 +351,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -385,7 +385,7 @@ client.upgrade({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -400,3 +400,3 @@ const _err = new Error()

data.socket.on('error', (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -414,7 +414,7 @@ throw _err

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -432,3 +432,3 @@ client.on('disconnect', () => {

}, (err, { opaque }) => {
t.strictEqual(opaque, 'asd')
t.equal(opaque, 'asd')
t.ok(err instanceof errors.InvalidArgumentError)

@@ -435,0 +435,0 @@ })

@@ -16,3 +16,3 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -40,3 +40,3 @@ const makeBody = () => {

const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -43,0 +43,0 @@ client.on('disconnect', () => {

@@ -16,12 +16,12 @@ 'use strict'

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.strictEqual(undefined, req.headers.foo)
t.strictEqual('bar', req.headers.bar)
t.strictEqual(undefined, req.headers['content-length'])
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
t.equal(undefined, req.headers.foo)
t.equal('bar', req.headers.bar)
t.equal(undefined, req.headers['content-length'])
res.setHeader('Content-Type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -37,5 +37,5 @@ const reqHeaders = {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
t.strictEqual(client.url.origin, `http://localhost:${server.address().port}`)
t.equal(client.url.origin, `http://localhost:${server.address().port}`)

@@ -51,5 +51,5 @@ const signal = new EE()

const { statusCode, headers, body } = data
t.strictEqual(statusCode, 200)
t.strictEqual(signal.listenerCount('abort'), 1)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(signal.listenerCount('abort'), 1)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -60,7 +60,7 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual(signal.listenerCount('abort'), 0)
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal(signal.listenerCount('abort'), 0)
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})
t.strictEqual(signal.listenerCount('abort'), 1)
t.equal(signal.listenerCount('abort'), 1)

@@ -73,4 +73,4 @@ client.request({

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -81,3 +81,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -92,18 +92,18 @@ })

const server = createServer((req, res) => {
t.strictEqual('/123', req.url)
t.strictEqual('HEAD', req.method)
t.strictEqual(`localhost:${server.address().port}`, req.headers.host)
t.equal('/123', req.url)
t.equal('HEAD', req.method)
t.equal(`localhost:${server.address().port}`, req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/123', method: 'HEAD' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
body

@@ -118,4 +118,4 @@ .resume()

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
body

@@ -134,18 +134,18 @@ .resume()

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual('example.com', req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal('example.com', req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello from ' + req.headers.host)
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'GET', headers: { host: 'example.com' } }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -156,3 +156,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello from example.com', Buffer.concat(bufs).toString('utf8'))
t.equal('hello from example.com', Buffer.concat(bufs).toString('utf8'))
})

@@ -167,18 +167,18 @@ })

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('HEAD', req.method)
t.strictEqual('example.com', req.headers.host)
t.equal('/', req.url)
t.equal('HEAD', req.method)
t.equal('example.com', req.headers.host)
res.setHeader('content-type', 'text/plain')
res.end('hello from ' + req.headers.host)
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'HEAD', headers: { host: 'example.com' } }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
body

@@ -195,4 +195,4 @@ .resume()

return function (req, res) {
t.strictEqual(req.url, '/')
t.strictEqual(req.method, 'POST')
t.equal(req.url, '/')
t.equal(req.method, 'POST')
t.notSame(req.headers['content-length'], null)

@@ -206,3 +206,3 @@

req.on('end', () => {
t.strictEqual(data, expected)
t.equal(data, expected)
res.end('hello')

@@ -219,11 +219,11 @@ })

const server = createServer(postServer(t, expected))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'POST', body: expected }, (err, data) => {
t.error(err)
t.strictEqual(data.statusCode, 200)
t.equal(data.statusCode, 200)
const bufs = []

@@ -235,3 +235,3 @@ data.body

.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -246,11 +246,11 @@ })

const server = createServer(postServer(t, ''))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'POST', body: '' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -261,3 +261,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -274,7 +274,7 @@ })

const server = createServer(postServer(t, expected))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -290,3 +290,3 @@ client.request({

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -297,3 +297,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -310,11 +310,11 @@ })

const server = createServer(postServer(t, expected.toString()))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'POST', body: expected }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -325,3 +325,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -338,7 +338,7 @@ })

const server = createServer(postServer(t, expected))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -355,3 +355,3 @@ client.request({

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -362,3 +362,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -377,7 +377,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -393,3 +393,3 @@ const body = new EE()

t.error(err)
t.strictEqual(data.statusCode, 200)
t.equal(data.statusCode, 200)
const bufs = []

@@ -400,6 +400,6 @@ data.body.on('data', (buf) => {

data.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})
t.strictDeepEqual(client.busy, true)
t.strictSame(client.busy, true)

@@ -430,6 +430,6 @@ body.on('close', () => {

const server = createServer(function (req, res) {
t.strictEqual(req.url, '/')
t.strictEqual(req.method, 'POST')
t.equal(req.url, '/')
t.equal(req.method, 'POST')
t.same(req.headers['content-length'], null)
t.strictEqual(req.headers['transfer-encoding'], 'chunked')
t.equal(req.headers['transfer-encoding'], 'chunked')

@@ -444,11 +444,11 @@ body.push(null)

req.on('end', () => {
t.strictEqual(data, 'asd')
t.equal(data, 'asd')
res.end('hello')
})
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -466,3 +466,3 @@ body = new Readable({

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -473,3 +473,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -487,7 +487,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -503,3 +503,3 @@ const body = new Readable({

process.nextTick(() => {
t.strictEqual(body.destroyed, true)
t.equal(body.destroyed, true)
})

@@ -532,7 +532,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -546,3 +546,3 @@ for (var i = 0; i < num; i++) {

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -553,3 +553,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('/' + i, Buffer.concat(bufs).toString('utf8'))
t.equal('/' + i, Buffer.concat(bufs).toString('utf8'))
})

@@ -568,7 +568,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -582,3 +582,3 @@ for (var i = 0; i < num; i++) {

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
body

@@ -602,12 +602,12 @@ .resume()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictDeepEqual(headers['set-cookie'], ['a cookie', 'another cookie', 'more cookies'])
t.equal(statusCode, 200)
t.strictSame(headers['set-cookie'], ['a cookie', 'another cookie', 'more cookies'])
const bufs = []

@@ -618,3 +618,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -629,10 +629,10 @@ })

const server = createServer((req, res) => {
t.strictEqual(req.headers.test, 'test')
t.equal(req.headers.test, 'test')
res.end()
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -658,3 +658,3 @@ const headers = { test: 'test' }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -667,3 +667,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -683,6 +683,6 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

const server = createServer((req, res) => {
t.strictEqual(req.url, path)
t.equal(req.url, path)
res.end()
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -695,3 +695,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -711,3 +711,3 @@ client.request({ path, method: 'GET' }, (err, data) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -720,3 +720,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -746,3 +746,3 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -753,3 +753,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -778,3 +778,3 @@ client.request({

setImmediate(() => {
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
this.push(null)

@@ -784,3 +784,3 @@ })

}).on('resume', () => {
t.strictEqual(client.size, 1)
t.equal(client.size, 1)
})

@@ -795,3 +795,3 @@ }, (err, data) => {

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
})

@@ -807,7 +807,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -821,3 +821,3 @@ for (let n = 0; n < 300; ++n) {

data.body.on('data', (chunk) => {
t.strictEqual(chunk.toString(), 'asd')
t.equal(chunk.toString(), 'asd')
}).on('end', () => {

@@ -863,7 +863,7 @@ t.pass()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -888,9 +888,9 @@ client.request({

t.strictEqual(client.running, 0)
t.equal(client.running, 0)
client.on('connect', () => {
t.strictEqual(client.running, 0)
t.equal(client.running, 0)
process.nextTick(() => {
t.strictEqual(client.running, 1)
t.equal(client.running, 1)
client.pipelining = 3
t.strictEqual(client.running, 2)
t.equal(client.running, 2)
})

@@ -909,7 +909,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -936,3 +936,3 @@ client.request({ path: '/', method: 'GET' }, (err, { body }) => {

}).on('end', () => {
t.strictEqual('asd', buf)
t.equal('asd', buf)
})

@@ -949,13 +949,13 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'GET' }, (err, data) => {
t.strictEqual(err.message, 'kaboom')
t.equal(err.message, 'kaboom')
})
client.request({ path: '/', method: 'GET' }, (err, data) => {
t.strictEqual(err.message, 'kaboom')
t.equal(err.message, 'kaboom')
})

@@ -974,7 +974,7 @@ client.on('connect', () => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -993,3 +993,3 @@ const body = new Readable({

client.request({ path: '/', method: 'POST', body }, (err, data) => {
t.strictEqual(err.message, 'asd')
t.equal(err.message, 'asd')
})

@@ -1005,3 +1005,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -1012,3 +1012,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -1022,5 +1022,5 @@ client[kConnect](() => {

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
})
})
})

@@ -17,7 +17,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -41,3 +41,3 @@ client.request({ path: '/', method: 'GET' }, function (err, data) {

t.error(err)
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -48,3 +48,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -62,3 +62,3 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -69,3 +69,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -96,3 +96,3 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -103,11 +103,11 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
let ticked = false
client.request({ path: '/', method: 'GET' }, (err) => {
t.strictEqual(ticked, true)
t.equal(ticked, true)
t.ok(err instanceof errors.ClientDestroyedError)
})
client.request({ path: '/', method: 'GET' }, (err) => {
t.strictEqual(ticked, true)
t.equal(ticked, true)
t.ok(err instanceof errors.ClientDestroyedError)

@@ -126,7 +126,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -142,4 +142,4 @@ makeRequest()

t.error(err)
t.strictEqual(client.closed, true)
t.strictEqual(done, true)
t.equal(client.closed, true)
t.equal(done, true)
})

@@ -163,7 +163,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -174,4 +174,4 @@ t.ok(makeRequest())

client.close((err) => {
t.strictEqual(err, null)
t.strictEqual(client.closed, true)
t.equal(err, null)
t.equal(client.closed, true)
})

@@ -198,7 +198,7 @@ client[kSocket].destroy()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -209,4 +209,4 @@ t.ok(makeRequest())

client.close((err) => {
t.strictEqual(err, null)
t.strictEqual(client.closed, true)
t.equal(err, null)
t.equal(client.closed, true)
})

@@ -228,3 +228,3 @@

const client = new Client('http://localhost:4000')
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -250,3 +250,3 @@ client.request({ path: '/', method: 'GET' }, (err) => {

const client = new Client('http://localhost:4000')
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -253,0 +253,0 @@ client.destroy()

@@ -260,3 +260,3 @@ 'use strict'

client.on('disconnect', (err) => {
t.strictEqual(err.code, 'UND_ERR_SOCKET')
t.equal(err.code, 'UND_ERR_SOCKET')
})

@@ -274,3 +274,3 @@

.on('error', (err) => {
t.strictEqual(err.code, 'UND_ERR_SOCKET')
t.equal(err.code, 'UND_ERR_SOCKET')
})

@@ -277,0 +277,0 @@ .resume()

@@ -11,8 +11,8 @@ 'use strict'

const queue = new FixedQueue()
t.strictEqual(queue.head, queue.tail)
t.equal(queue.head, queue.tail)
t.ok(queue.isEmpty())
queue.push('a')
t.ok(!queue.isEmpty())
t.strictEqual(queue.shift(), 'a')
t.strictEqual(queue.shift(), null)
t.equal(queue.shift(), 'a')
t.equal(queue.shift(), null)
})

@@ -31,10 +31,10 @@

t.notStrictEqual(queue.head, queue.tail)
t.not(queue.head, queue.tail)
for (let i = 0; i < 2047; i++) {
t.strictEqual(queue.shift(), 'a')
t.equal(queue.shift(), 'a')
}
t.strictEqual(queue.head, queue.tail)
t.equal(queue.head, queue.tail)
t.ok(!queue.isEmpty())
t.strictEqual(queue.shift(), 'a')
t.equal(queue.shift(), 'a')
t.ok(queue.isEmpty())
})

@@ -30,5 +30,5 @@ 'use strict'

const registry = new FinalizationRegistry((data) => {
t.strictEqual(data, 'test')
t.strictEqual(disconnected, true)
t.strictEqual(weakRef.deref(), undefined)
t.equal(data, 'test')
t.equal(disconnected, true)
t.equal(weakRef.deref(), undefined)
})

@@ -73,5 +73,5 @@

const registry = new FinalizationRegistry((data) => {
t.strictEqual(data, 'test')
t.strictEqual(disconnected, true)
t.strictEqual(weakRef.deref(), undefined)
t.equal(data, 'test')
t.equal(disconnected, true)
t.equal(weakRef.deref(), undefined)
})

@@ -78,0 +78,0 @@

@@ -87,3 +87,3 @@ 'use strict'

// t.error(err)
// t.strictEqual(data.statusCode, 200)
// t.equal(data.statusCode, 200)
// data.body.resume()

@@ -93,3 +93,3 @@ // })

// t.error(err)
// t.strictEqual(data.statusCode, 200)
// t.equal(data.statusCode, 200)
// data.body.resume()

@@ -122,3 +122,3 @@ // })

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)

@@ -140,8 +140,8 @@ client.request({

})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
})
})
})
t.strictEqual(client.busy, true)
t.equal(client.busy, true)
})
})

@@ -12,3 +12,3 @@ 'use strict'

const server = createServer((req, res) => {
t.similar(req.headers, { a: '1', b: '2', c: '3' })
t.match(req.headers, { a: '1', b: '2', c: '3' })
res.end()

@@ -45,5 +45,5 @@ })

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'headers array must be even')
t.equal(err.message, 'headers array must be even')
})
})
})

@@ -31,3 +31,3 @@ 'use strict'

response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -56,3 +56,3 @@ })

}, (err) => {
t.strictEqual(err.code, 'HPE_INVALID_CONSTANT')
t.equal(err.code, 'HPE_INVALID_CONSTANT')
})

@@ -81,3 +81,3 @@ client.on('disconnect', () => {

}, (err) => {
t.strictEqual(err.message, 'bad response')
t.equal(err.message, 'bad response')
})

@@ -84,0 +84,0 @@ client.on('disconnect', () => {

@@ -12,8 +12,8 @@ 'use strict'

const server = createServer(pem, (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -26,8 +26,8 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -38,3 +38,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -41,0 +41,0 @@ })

@@ -33,3 +33,3 @@ 'use strict'

}
t.strictDeepEqual(headers2, headers)
t.strictSame(headers2, headers)
data.body

@@ -36,0 +36,0 @@ .resume()

@@ -20,7 +20,7 @@ const net = require('net')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -27,0 +27,0 @@ client.request({

@@ -12,3 +12,3 @@ 'use strict'

const server = createServer((req, res) => {
t.strictDeepEqual(req.headers['transfer-encoding'], undefined)
t.strictSame(req.headers['transfer-encoding'], undefined)
res.end()

@@ -29,3 +29,3 @@ })

client[kConnect](() => {
t.strictEqual(client.running, 0)
t.equal(client.running, 0)
client.pipeline({

@@ -35,5 +35,5 @@ method: 'GET',

}, ({ body }) => body).end().resume()
t.strictEqual(client.busy, true)
t.strictDeepEqual(client.running, 0)
t.strictDeepEqual(client.pending, 1)
t.equal(client.busy, true)
t.strictSame(client.running, 0)
t.strictSame(client.pending, 1)

@@ -44,7 +44,7 @@ client.pipeline({

}, ({ body }) => body).end().resume()
t.strictEqual(client.busy, true)
t.strictDeepEqual(client.running, 0)
t.strictDeepEqual(client.pending, 2)
t.equal(client.busy, true)
t.strictSame(client.running, 0)
t.strictSame(client.pending, 2)
process.nextTick(() => {
t.strictEqual(client.running, 2)
t.equal(client.running, 2)
})

@@ -89,5 +89,5 @@ })

})
t.strictEqual(client.busy, true)
t.strictDeepEqual(client.running, 0)
t.strictDeepEqual(client.pending, 1)
t.equal(client.busy, true)
t.strictSame(client.running, 0)
t.strictSame(client.pending, 1)

@@ -98,5 +98,5 @@ client.pipeline({

}, ({ body }) => body).end().resume()
t.strictEqual(client.busy, true)
t.strictDeepEqual(client.running, 0)
t.strictDeepEqual(client.pending, 2)
t.equal(client.busy, true)
t.strictSame(client.running, 0)
t.strictSame(client.pending, 2)

@@ -107,8 +107,8 @@ client.pipeline({

}, ({ body }) => body).end().resume()
t.strictEqual(client.busy, true)
t.strictDeepEqual(client.running, 0)
t.strictDeepEqual(client.pending, 3)
t.equal(client.busy, true)
t.strictSame(client.running, 0)
t.strictSame(client.pending, 3)
process.nextTick(() => {
t.strictEqual(client.running, 3)
t.equal(client.running, 3)
})

@@ -115,0 +115,0 @@

@@ -27,3 +27,3 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -35,12 +35,12 @@ server.listen(0, () => {

})
t.tearDown(pool.close.bind(pool))
t.teardown(pool.close.bind(pool))
pool.on('connect', (client) => {
t.strictEqual(client instanceof Client, true)
t.equal(client instanceof Client, true)
})
pool.on('disconnect', (client, error) => {
t.true(client instanceof Client)
t.true(error instanceof errors.InformationalError)
t.strictEqual(error.code, 'UND_ERR_INFO')
t.strictEqual(error.message, 'socket idle timeout')
t.ok(client instanceof Client)
t.ok(error instanceof errors.InformationalError)
t.equal(error.code, 'UND_ERR_INFO')
t.equal(error.message, 'socket idle timeout')
})

@@ -64,19 +64,19 @@

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = undici(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
t.strictEqual(client.url.origin, `http://localhost:${server.address().port}`)
t.equal(client.url.origin, `http://localhost:${server.address().port}`)
client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -87,11 +87,11 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})
t.strictEqual(client.destroyed, false)
t.strictEqual(client.closed, false)
t.equal(client.destroyed, false)
t.equal(client.closed, false)
client.close((err) => {
t.error(err)
t.strictEqual(client.destroyed, true)
t.equal(client.destroyed, true)
client.destroy((err) => {

@@ -104,3 +104,3 @@ t.error(err)

})
t.strictEqual(client.closed, true)
t.equal(client.closed, true)
})

@@ -113,8 +113,8 @@ })

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -125,8 +125,8 @@ server.listen(0, async () => {

const client = undici(url)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -137,3 +137,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -160,7 +160,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = undici(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -182,16 +182,16 @@ await client.request({ path: '/', method: 'GET' })

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
await promisify(server.listen.bind(server))(0)
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
const { statusCode, headers, body } = await client.request({ path: '/', method: 'GET' })
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')

@@ -207,16 +207,16 @@ body.resume()

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
await promisify(server.listen.bind(server))(0)
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
await client.stream({ path: '/', method: 'GET' }, ({ statusCode, headers }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
return new PassThrough()

@@ -232,7 +232,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = undici(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -252,17 +252,17 @@ await client.stream({ path: '/', method: 'GET' }, () => {

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = undici(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))
const bufs = []
client.pipeline({ path: '/', method: 'GET' }, ({ statusCode, headers, body }) => {
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
return body

@@ -275,3 +275,3 @@ })

.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -316,7 +316,7 @@ })

const d1 = seen.shift() // d1 = c0
t.strictEqual(d1.id, 0)
t.equal(d1.id, 0)
const d2 = seen.shift() // d1 = c0
t.strictEqual(d1.id, 0)
t.equal(d1.id, 0)
t.strictEqual(d1.id, d2.id)
t.equal(d1.id, d2.id)

@@ -330,8 +330,8 @@ pool.dispatch({}, noop) // d3 = c0

const d3 = seen.shift()
t.strictEqual(d3.id, 0)
t.equal(d3.id, 0)
const d4 = seen.shift()
t.strictEqual(d4.id, 1)
t.equal(d4.id, 1)
t.strictEqual(d3.id, d2.id)
t.notStrictEqual(d3.id, d4.id)
t.equal(d3.id, d2.id)
t.not(d3.id, d4.id)

@@ -345,10 +345,10 @@ pool.dispatch({}, noop) // d5 = c1

const d5 = seen.shift()
t.strictEqual(d5.id, 1)
t.equal(d5.id, 1)
const d6 = seen.shift()
t.strictEqual(d6.id, 0)
t.equal(d6.id, 0)
t.strictEqual(d5.id, d4.id)
t.strictEqual(d3.id, d6.id)
t.equal(d5.id, d4.id)
t.equal(d3.id, d6.id)
t.strictEqual(total, 2)
t.equal(total, 2)

@@ -364,8 +364,8 @@ t.end()

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -382,6 +382,6 @@ server.listen(0, async () => {

client.on('connect', () => {
t.strictEqual(client.connected, ++connected)
t.equal(client.connected, ++connected)
})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -391,4 +391,4 @@ for (let n = 1; n <= 8; ++n) {

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -399,9 +399,9 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})
t.strictEqual(client.pending, n)
t.strictEqual(client.busy, n >= 2)
t.strictEqual(client.size, n)
t.strictEqual(client.running, 0)
t.equal(client.pending, n)
t.equal(client.busy, n >= 2)
t.equal(client.size, n)
t.equal(client.running, 0)
}

@@ -418,3 +418,3 @@ })

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid connections')
t.equal(err.message, 'invalid connections')
}

@@ -426,3 +426,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'invalid connections')
t.equal(err.message, 'invalid connections')
}

@@ -448,7 +448,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -467,6 +467,6 @@ const { headers, socket } = await client.upgrade({

socket.on('close', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})
t.deepEqual(headers, {
t.same(headers, {
hello: 'world',

@@ -498,7 +498,7 @@ connection: 'upgrade',

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -515,3 +515,3 @@ const { socket } = await client.connect({

socket.on('end', () => {
t.strictEqual(recvData.toString(), 'Body')
t.equal(recvData.toString(), 'Body')
})

@@ -530,7 +530,7 @@

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -545,3 +545,3 @@ let buf = ''

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
},

@@ -552,3 +552,3 @@ onData (chunk) {

onComplete () {
t.strictEqual(buf, 'asd')
t.equal(buf, 'asd')
},

@@ -579,3 +579,3 @@ onError () {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -586,3 +586,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -596,3 +596,3 @@ for (let n = 0; n < 300; ++n) {

data.body.on('data', (chunk) => {
t.strictEqual(chunk.toString(), 'asd')
t.equal(chunk.toString(), 'asd')
}).on('end', () => {

@@ -615,7 +615,7 @@ t.pass()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -648,7 +648,7 @@ try {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -673,3 +673,3 @@ try {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -681,3 +681,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -691,3 +691,3 @@ client.dispatch({

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
},

@@ -720,3 +720,3 @@ onData (chunk) {

onError (err) {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.equal(err.code, 'UND_ERR_INVALID_ARG')
}

@@ -733,3 +733,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -741,3 +741,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -751,3 +751,3 @@ client.dispatch({

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
},

@@ -769,3 +769,3 @@ onData (chunk) {

}, (err) => {
t.strictEqual(err.code, 'UND_ERR_ABORTED')
t.equal(err.code, 'UND_ERR_ABORTED')
})

@@ -782,3 +782,3 @@ signal.emit('abort')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -790,3 +790,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -800,3 +800,3 @@ client.dispatch({

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
},

@@ -818,3 +818,3 @@ onData (chunk) {

}, ({ body }) => body, (err) => {
t.strictEqual(err.code, 'UND_ERR_ABORTED')
t.equal(err.code, 'UND_ERR_ABORTED')
})

@@ -831,3 +831,3 @@ signal.emit('abort')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -839,3 +839,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -849,3 +849,3 @@ client.dispatch({

onHeaders (statusCode, headers) {
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
},

@@ -867,3 +867,3 @@ onData (chunk) {

}, ({ body }) => body).end().on('error', (err) => {
t.strictEqual(err.code, 'UND_ERR_ABORTED')
t.equal(err.code, 'UND_ERR_ABORTED')
})

@@ -880,3 +880,3 @@ signal.emit('abort')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -888,3 +888,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -906,4 +906,4 @@ {

}, (err) => {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(body.destroyed, true)
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(body.destroyed, true)
})

@@ -924,4 +924,4 @@ }

}, (err) => {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(body.destroyed, true)
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(body.destroyed, true)
})

@@ -938,3 +938,3 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -946,3 +946,3 @@ server.listen(0, async () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -962,4 +962,4 @@ {

}, (err) => {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(body.destroyed, true)
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(body.destroyed, true)
})

@@ -978,4 +978,4 @@ }

}, (err) => {
t.strictEqual(err.code, 'UND_ERR_INVALID_ARG')
t.strictEqual(body.destroyed, true)
t.equal(err.code, 'UND_ERR_INVALID_ARG')
t.equal(body.destroyed, true)
})

@@ -992,3 +992,3 @@ }

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -1000,3 +1000,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1040,3 +1040,3 @@ client.request({

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -1048,3 +1048,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1067,3 +1067,3 @@ client.destroy()

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -1075,3 +1075,3 @@ server.listen(0, async () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -1083,3 +1083,3 @@ const _err = new Error()

}, (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})

@@ -1091,10 +1091,10 @@

}, (err) => {
t.strictEqual(err, _err)
t.equal(err, _err)
})
t.strictEqual(client.destroyed, false)
t.equal(client.destroyed, false)
client.destroy(_err, () => {
t.pass()
})
t.strictEqual(client.destroyed, true)
t.equal(client.destroyed, true)

@@ -1101,0 +1101,0 @@ client.request({

@@ -12,17 +12,17 @@ 'use strict'

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
try {
const { statusCode, headers, body } = await client.request({ path: '/', method: 'GET' })
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -33,3 +33,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -44,4 +44,4 @@ } catch (err) {

return function (req, res) {
t.strictEqual(req.url, '/')
t.strictEqual(req.method, 'POST')
t.equal(req.url, '/')
t.equal(req.method, 'POST')

@@ -54,3 +54,3 @@ req.setEncoding('utf8')

req.on('end', () => {
t.strictEqual(data, expected)
t.equal(data, expected)
res.end('hello')

@@ -67,11 +67,11 @@ })

const server = createServer(postServer(t, expected))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
try {
const { statusCode, body } = await client.request({ path: '/', method: 'POST', body: expected })
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -82,3 +82,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -97,11 +97,11 @@ } catch (err) {

const server = createServer(postServer(t, expected.toString()))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
try {
const { statusCode, body } = await client.request({ path: '/', method: 'POST', body: expected })
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -112,3 +112,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -127,7 +127,7 @@ } catch (err) {

const server = createServer(postServer(t, expected))
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -143,3 +143,3 @@ try {

})
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -150,3 +150,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -175,7 +175,7 @@ } catch (err) {

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
// needed to check for a warning on the maxListeners on the socket
process.on('warning', t.fail)
t.tearDown(() => {
t.teardown(() => {
process.removeListener('warning', t.fail)

@@ -188,3 +188,3 @@ })

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -208,3 +208,3 @@ for (var i = 0; i < num; i++) {

const { statusCode, body } = await client.request({ path: '/' + i, method: 'GET' })
t.strictEqual(statusCode, 200)
t.equal(statusCode, 200)
const bufs = []

@@ -215,3 +215,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('/' + i, Buffer.concat(bufs).toString('utf8'))
t.equal('/' + i, Buffer.concat(bufs).toString('utf8'))
})

@@ -228,17 +228,17 @@ } catch (err) {

const server = createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
try {
const { statusCode, headers, body } = await client.request({ path: '/', method: 'GET' })
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -249,3 +249,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -252,0 +252,0 @@ } catch (err) {

@@ -400,3 +400,3 @@ 'use strict'

response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -436,3 +436,3 @@ })

response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -439,0 +439,0 @@ })

@@ -28,3 +28,3 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -35,3 +35,3 @@ server.listen(0, () => {

})
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -38,0 +38,0 @@ client.request({ path: '/', method: 'GET', opaque: 'asd' }, (err, data) => {

@@ -15,7 +15,7 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -32,3 +32,3 @@ makeRequest()

data.body.on('error', (err) => {
t.strictEqual(err.code, -100)
t.equal(err.code, -100)
})

@@ -48,7 +48,7 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -65,3 +65,3 @@ makeRequest()

data.body.on('error', (err) => {
t.strictEqual(err.code, -100)
t.equal(err.code, -100)
})

@@ -68,0 +68,0 @@

@@ -17,4 +17,4 @@ 'use strict'

server.once('request', (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')

@@ -24,3 +24,3 @@ res.end('hello')

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -33,3 +33,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -42,3 +42,3 @@ client.request({

t.ok(err instanceof errors.HeadersTimeoutError) // we are expecting an error
t.strictEqual(data.opaque, 'asd')
t.equal(data.opaque, 'asd')
})

@@ -51,4 +51,4 @@

t.error(err)
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -59,3 +59,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -79,3 +79,3 @@ })

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -87,3 +87,3 @@ server.listen(0, () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -97,3 +97,3 @@ client.request({ path: '/', method: 'GET' }, (err, result) => {

result.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -100,0 +100,0 @@ })

@@ -104,24 +104,24 @@ 'use strict'

t.plan(7)
t.strictEqual(serverRequests, 6)
t.strictEqual(
t.equal(serverRequests, 6)
t.equal(
clientSessions.first.toString('hex'),
clientSessions['first-reuse'].toString('hex')
)
t.notStrictEqual(
t.not(
clientSessions.first.toString('hex'),
clientSessions['cipher-change'].toString('hex')
)
t.notStrictEqual(
t.not(
clientSessions.first.toString('hex'),
clientSessions['before-drop'].toString('hex')
)
t.notStrictEqual(
t.not(
clientSessions['cipher-change'].toString('hex'),
clientSessions['before-drop'].toString('hex')
)
t.notStrictEqual(
t.not(
clientSessions['before-drop'].toString('hex'),
clientSessions['after-drop'].toString('hex')
)
t.strictEqual(
t.equal(
clientSessions['after-drop'].toString('hex'),

@@ -128,0 +128,0 @@ clientSessions['after-drop-reuse'].toString('hex')

@@ -12,8 +12,8 @@ 'use strict'

const client = new Client('https://www.github.com')
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ method: 'GET', path: '/' }, (err, data) => {
t.error(err)
t.strictEqual(data.statusCode, 301)
t.strictEqual(client[kSocket].authorized, true)
t.equal(data.statusCode, 301)
t.equal(client[kSocket].authorized, true)

@@ -36,8 +36,8 @@ data.body

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ method: 'GET', path: '/' }, (err, data) => {
t.error(err)
t.strictEqual(data.statusCode, 301)
t.strictEqual(client[kSocket].authorized, true)
t.equal(data.statusCode, 301)
t.equal(client[kSocket].authorized, true)

@@ -56,3 +56,3 @@ data.body

const client = new Client('https://140.82.112.4')
t.tearDown(client.destroy.bind(client))
t.teardown(client.destroy.bind(client))

@@ -68,4 +68,4 @@ let didDisconnect = false

t.error(err)
t.strictEqual(data.statusCode, 301)
t.strictEqual(client[kSocket].authorized, true)
t.equal(data.statusCode, 301)
t.equal(client[kSocket].authorized, true)

@@ -95,4 +95,4 @@ data.body

}, (err, data) => {
t.strictEqual(didDisconnect, true)
t.strictEqual(client[kSocket].authorized, false)
t.equal(didDisconnect, true)
t.equal(client[kSocket].authorized, false)
t.ok(err)

@@ -111,3 +111,3 @@ })

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -122,5 +122,5 @@ client.request({

t.error(err)
t.strictEqual(client.running, 1)
t.strictEqual(data.statusCode, 301)
t.strictEqual(client[kSocket].authorized, true)
t.equal(client.running, 1)
t.equal(data.statusCode, 301)
t.equal(client[kSocket].authorized, true)

@@ -135,4 +135,4 @@ client.request({

t.error(err)
t.strictEqual(data.statusCode, 301)
t.strictEqual(client[kSocket].authorized, true)
t.equal(data.statusCode, 301)
t.equal(client[kSocket].authorized, true)

@@ -139,0 +139,0 @@ data.body

@@ -14,9 +14,9 @@ 'use strict'

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual('localhost', req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal('localhost', req.headers.host)
res.setHeader('Content-Type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -30,3 +30,3 @@ server.listen('/var/tmp/test3.sock', () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -36,4 +36,4 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

const { statusCode, headers, body } = data
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -44,3 +44,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -55,9 +55,9 @@ })

const server = http.createServer((req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.strictEqual('localhost', req.headers.host)
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal('localhost', req.headers.host)
res.setHeader('Content-Type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -71,3 +71,3 @@ server.listen('/var/tmp/test3.sock', () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -77,4 +77,4 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

const { statusCode, headers, body } = data
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -85,3 +85,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -96,8 +96,8 @@ })

const server = https.createServer(pem, (req, res) => {
t.strictEqual('/', req.url)
t.strictEqual('GET', req.method)
t.equal('/', req.url)
t.equal('GET', req.method)
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -114,3 +114,3 @@ server.listen('/var/tmp/test8.sock', () => {

})
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))

@@ -120,4 +120,4 @@ client.request({ path: '/', method: 'GET' }, (err, data) => {

const { statusCode, headers, body } = data
t.strictEqual(statusCode, 200)
t.strictEqual(headers['content-type'], 'text/plain')
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []

@@ -128,3 +128,3 @@ body.on('data', (buf) => {

body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})

@@ -131,0 +131,0 @@ })

@@ -13,3 +13,3 @@ 'use strict'

})
t.tearDown(server.close.bind(server))
t.teardown(server.close.bind(server))

@@ -23,7 +23,7 @@ server.listen(0, () => {

const client = new Client(url)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: null, method: 'GET' }, (err, res) => {
t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'path must be a string')
t.equal(err.message, 'path must be a string')
})

@@ -33,3 +33,3 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'path must be an absolute URL or start with a slash')
t.equal(err.message, 'path must be an absolute URL or start with a slash')
})

@@ -42,7 +42,7 @@ })

const client = new Client(url)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: null }, (err, res) => {
t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'method must be a string')
t.equal(err.message, 'method must be a string')
})

@@ -55,7 +55,7 @@ })

const client = new Client(url)
t.tearDown(client.close.bind(client))
t.teardown(client.close.bind(client))
client.request({ path: '/', method: 'POST', body: 42 }, (err, res) => {
t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'body must be a string, a Buffer or a Readable stream')
t.equal(err.message, 'body must be a string, a Buffer or a Readable stream')
})

@@ -65,5 +65,5 @@

t.ok(err instanceof errors.InvalidArgumentError)
t.strictEqual(err.message, 'body must be a string, a Buffer or a Readable stream')
t.equal(err.message, 'body must be a string, a Buffer or a Readable stream')
})
})
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc