summaryrefslogtreecommitdiff
path: root/test/parallel/test-outgoing-message-pipe.js
blob: 7cfe3687ecc8a7e07474080fd314ce85ae36c7ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';
const common = require('../common');
const OutgoingMessage = require('_http_outgoing').OutgoingMessage;

// Verify that an error is thrown upon a call to `OutgoingMessage.pipe`.

const outgoingMessage = new OutgoingMessage();
common.expectsError(
  () => { outgoingMessage.pipe(outgoingMessage); },
  {
    code: 'ERR_STREAM_CANNOT_PIPE',
    type: Error
  }
);