Skip to content

Commit

Permalink
test: add test to improve coverage in http2-compat-serverresponse
Browse files Browse the repository at this point in the history
PR-URL: #44970
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Adrian Estrada <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Cesar-M-Diaz authored and RafaelGSS committed Nov 10, 2022
1 parent 4825786 commit ea0cfc9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-http2-compat-serverresponse-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,21 @@ const assert = require('assert');
}));
}));
}

{
const server = createServer();
server.listen(0, mustCall(() => {
const port = server.address().port;
const url = `http://localhost:${port}`;
const client = connect(url, mustCall(() => {
client.request();
}));

server.once('request', mustCall((request, response) => {
response.destroy();
assert.strictEqual(response.write('asd', mustNotCall()), false);
client.destroy();
server.close();
}));
}));
}

0 comments on commit ea0cfc9

Please sign in to comment.