summaryrefslogtreecommitdiff
path: root/test/parallel/test-outgoing-message-destroy.js
blob: 0ee7b5f40ef9fa791890f8541df17ebc0107eac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';

// Test that http.OutgoingMessage,prototype.destroy() returns `this`.
require('../common');

const assert = require('assert');
const http = require('http');
const outgoingMessage = new http.OutgoingMessage();

assert.strictEqual(outgoingMessage.destroyed, false);
assert.strictEqual(outgoingMessage.destroy(), outgoingMessage);
assert.strictEqual(outgoingMessage.destroyed, true);
assert.strictEqual(outgoingMessage.destroy(), outgoingMessage);