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 <soyjuanarbol@gmail.com>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Cesar-M-Diaz authored and danielleadams committed Jan 3, 2023
1 parent dfc2419 commit 6e3227b
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 6e3227b

Please sign in to comment.