Uh oh!
There was an error while loading. Please reload this page.
test: improve http-client coverage - #33633
Conversation
There was a problem hiding this comment.
| code: /ERR_INVALID_ARG_TYPE/ | |
| code: 'ERR_INVALID_ARG_TYPE', | |
| message: /insecureHTTPParser/ |
There was a problem hiding this comment.
The test should definitely hit the mentioned code line but it would be great to write a test that actually verifies that the callback is also called and ideally, this test case would not cause any errors, since it's a legit code path.
There was a problem hiding this comment.
@BridgeAR Here is a rewrote version, which can make cb be called, but it's a little longer than previous version, so I am not sure whether it's ok, could you help me to check?
'use strict';constcommon=require('../common');consthttp=require('http');constassert=require('assert');constClientRequest=require('http').ClientRequest;{constserver=http.createServer(common.mustCall((req,res)=>{res.writeHead(200);res.end('hello world');})).listen(80,'127.0.0.1');constreq=newClientRequest(common.mustCall((response)=>{letbody='';response.setEncoding('utf8');response.on('data',(chunk)=>{body+=chunk;});response.on('end',common.mustCall(()=>{assert.strictEqual(body,'hello world');server.close();}));}));req.end();}BridgeAR
commented
May 30, 2020
@KuthorX thank you very much for your contribution! This is already looking pretty good, just left two minor comments. |
8ae28ff to
2935f72CompareKuthorX
commented
Sep 4, 2020
Could someone help me to review lastest commit? Any suggestion will be appreciated. |
nodejs-github-bot
commented
Dec 24, 2020
af3315a to
d64869dCompareaduh95
commented
Sep 19, 2023
Ping @nodejs/http for reviews. |
d64869d to
289444eCompareShogunPanda
commented
Oct 6, 2023
The changes look fine to me. There is only one test failing as you're using port 80. Can you use another port? |
KuthorX
commented
Oct 9, 2023
thanks, has changed to 8080 |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Oct 10, 2023
KuthorX
commented
Oct 11, 2023
looks like some ci fail, maybe I should merge main branch? @ShogunPanda |
nodejs-github-bot
commented
Oct 11, 2023
nodejs-github-bot
commented
Oct 29, 2023
nodejs-github-bot
commented
Oct 30, 2023
nodejs-github-bot
commented
Dec 4, 2023
nodejs-github-bot
commented
Dec 18, 2023
nodejs-github-bot
commented
Dec 19, 2023
nodejs-github-bot
commented
Dec 19, 2023
Landed in c925039 |
PR-URL: nodejs#33633 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
After 3 years, it merged, thank you guys 😌 |
PR-URL: #33633 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33633 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
Based on https://coverage.nodejs.org/coverage-d12d5ef3ef8e5d9f/lib/_http_client.js.html, I try to improve coverage to line 120 (http-client-input-function), 194-197 (http-client-insecure-http-parser-error)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes