summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-outgoing-end-types.js
blob: 20b443bff2c1f529d9fbf2fdb876298dde3c99d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

const httpServer = http.createServer(common.mustCall(function(req, res) {
  httpServer.close();
  assert.throws(() => {
    res.end(['Throws.']);
  }, {
    code: 'ERR_INVALID_ARG_TYPE'
  });
  res.end();
}));

httpServer.listen(0, common.mustCall(function() {
  http.get({ port: this.address().port });
}));