Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jun 20, 2020
1 parent 299b2fd commit 402fc26
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/parallel/test-http-server-write-end-after-end.js
Expand Up @@ -11,21 +11,19 @@ function handle(req, res) {
res.write('hello');
res.end();

setImmediate(() => {
// TODO: Known issues. OutgoingMessage does not always invoke callback
// in end. Also streams don't propagate write after end to callback.
setImmediate(common.mustCall(() => {
res.end('world');
process.nextTick(() => {
server.close();
});
// res.end('world', common.mustCall((err) => {
// common.expectsError({
// code: 'ERR_STREAM_WRITE_AFTER_END',
// name: 'Error'
// })(err);
// server.close();
// }));
});
res.write('world', common.mustCall((err) => {
common.expectsError({
code: 'ERR_STREAM_WRITE_AFTER_END',
name: 'Error'
})(err);
server.close();
}));
}));
}

server.listen(0, common.mustCall(() => {
Expand Down

0 comments on commit 402fc26

Please sign in to comment.