Remove excessive copyright/license boilerplate
[platform/upstream/nodejs.git] / test / parallel / test-http-abort-before-end.js
1 var common = require('../common');
2 var http = require('http');
3 var assert = require('assert');
4
5 var server = http.createServer(function(req, res) {
6   assert(false); // should not be called
7 });
8
9 server.listen(common.PORT, function() {
10   var req = http.request({method: 'GET', host: '127.0.0.1', port: common.PORT});
11
12   req.on('error', function(ex) {
13     // https://github.com/joyent/node/issues/1399#issuecomment-2597359
14     // abort() should emit an Error, not the net.Socket object
15     assert(ex instanceof Error);
16   });
17
18   req.abort();
19   req.end();
20
21   server.close();
22 });