Skip to content

Commit

Permalink
Support for Node v17 (#1063)
Browse files Browse the repository at this point in the history
Fixes #1061
  • Loading branch information
mcollina authored Oct 15, 2021
1 parent 68a1794 commit 14ded8b
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions test/client-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,9 +1194,15 @@ test('SocketError should expose socket details (net)', (t) => {

client.request({ path: '/', method: 'GET' }, (err, data) => {
t.ok(err instanceof errors.SocketError)
t.equal(err.socket.remoteFamily, 'IPv4')
t.equal(err.socket.localAddress, '127.0.0.1')
t.equal(err.socket.remoteAddress, '127.0.0.1')
if (err.socket.remoteFamily === 'IPv4') {
t.equal(err.socket.remoteFamily, 'IPv4')
t.equal(err.socket.localAddress, '127.0.0.1')
t.equal(err.socket.remoteAddress, '127.0.0.1')
} else {
t.equal(err.socket.remoteFamily, 'IPv6')
t.equal(err.socket.localAddress, '::1')
t.equal(err.socket.remoteAddress, '::1')
}
t.type(err.socket.localPort, 'number')
t.type(err.socket.remotePort, 'number')
t.type(err.socket.bytesWritten, 'number')
Expand Down Expand Up @@ -1225,9 +1231,15 @@ test('SocketError should expose socket details (tls)', (t) => {

client.request({ path: '/', method: 'GET' }, (err, data) => {
t.ok(err instanceof errors.SocketError)
t.equal(err.socket.remoteFamily, 'IPv4')
t.equal(err.socket.localAddress, '127.0.0.1')
t.equal(err.socket.remoteAddress, '127.0.0.1')
if (err.socket.remoteFamily === 'IPv4') {
t.equal(err.socket.remoteFamily, 'IPv4')
t.equal(err.socket.localAddress, '127.0.0.1')
t.equal(err.socket.remoteAddress, '127.0.0.1')
} else {
t.equal(err.socket.remoteFamily, 'IPv6')
t.equal(err.socket.localAddress, '::1')
t.equal(err.socket.remoteAddress, '::1')
}
t.type(err.socket.localPort, 'number')
t.type(err.socket.remotePort, 'number')
t.type(err.socket.bytesWritten, 'number')
Expand Down

0 comments on commit 14ded8b

Please sign in to comment.