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