mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 23:56:58 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
23 lines
593 B
JavaScript
23 lines
593 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
const server = http.Server(common.mustCall(function(req, res) {
|
|
res.on('error', common.mustCall(function onResError(err) {
|
|
assert.strictEqual(err.message, 'write after end');
|
|
}));
|
|
|
|
res.write('This should write.');
|
|
res.end();
|
|
|
|
const r = res.write('This should raise an error.');
|
|
assert.equal(r, true, 'write after end should return true');
|
|
}));
|
|
|
|
server.listen(0, function() {
|
|
http.get({port: this.address().port}, function(res) {
|
|
server.close();
|
|
});
|
|
});
|