0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-http-incoming-message-destroy.js
cjihrig ff6535a433
http: return this from IncomingMessage#destroy()
This commit updates IncomingMessage#destroy() to return `this`
for consistency with other readable streams.

PR-URL: https://github.com/nodejs/node/pull/32789
Fixes: https://github.com/nodejs/node/issues/32772
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>
2020-05-09 13:57:28 -04:00

11 lines
289 B
JavaScript

'use strict';
// Test that http.IncomingMessage,prototype.destroy() returns `this`.
require('../common');
const assert = require('assert');
const http = require('http');
const incomingMessage = new http.IncomingMessage();
assert.strictEqual(incomingMessage.destroy(), incomingMessage);