mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 14:25:18 +00:00

This commit updates OutgoingMessage#destroy() to return `this` for consistency with other writable streams. PR-URL: https://github.com/nodejs/node/pull/32789 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
14 lines
460 B
JavaScript
14 lines
460 B
JavaScript
'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);
|