Skip to content

Commit

Permalink
Fix Node v16 support and update tap (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina authored Apr 21, 2021
1 parent 39eba71 commit da824a8
Show file tree
Hide file tree
Showing 44 changed files with 1,035 additions and 1,027 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [10.16.0, 10.x, 12.3.0, 12.18.0, 12.x, 14.0.0, 14.x, 15.x]
node-version: [10.16.0, 10.x, 12.3.0, 12.18.0, 12.x, 14.0.0, 14.x, 15.x, 16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .taprc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
esm: false
ts: false
jsx: false
flow: false
coverage: true
expose-gc: true
timeout: 60
check-coverage: false
12 changes: 10 additions & 2 deletions lib/core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class Parser extends HTTPParser {
client[kMaxHeadersSize],
0
)
} else if (nodeMajorVersion > 12) {
} else if (nodeMajorVersion > 12 && nodeMajorVersion < 16) {
super()
this.initialize(
HTTPParser.RESPONSE,
Expand All @@ -372,8 +372,16 @@ class Parser extends HTTPParser {
insecureHTTPParser,
0
)
} else if (nodeMajorVersion >= 16) {
super()
this.initialize(
HTTPParser.RESPONSE,
{},
client[kMaxHeadersSize],
0
)
} else {
super(HTTPParser.RESPONSE, false)
super(HTTPParser.RESPONSE)
}

this.client = client
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"proxyquire": "^2.0.1",
"snazzy": "^8.0.0",
"standard": "^14.3.4",
"tap": "^14.10.8",
"tap": "^15.0.0",
"tsd": "^0.13.1"
},
"pre-commit": [
Expand Down
2 changes: 1 addition & 1 deletion test/abort-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ for (const { AbortControllerImpl, controllerName } of controllers) {
bufs.push(buf)
})
response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/abort-event-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('Abort before sending request (no body)', (t) => {
bufs.push(buf)
})
response.body.on('end', () => {
t.strictEqual('hello', Buffer.concat(bufs).toString('utf8'))
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})

Expand Down
Loading

0 comments on commit da824a8

Please sign in to comment.