Skip to content
Permalink
Browse files

test: increase coverage for _http_incoming.js

Add coverage for IncomingMessage.prototype.connection setter.

PR-URL: #31093
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
  • Loading branch information
Trott authored and BridgeAR committed Dec 25, 2019
1 parent b8ccf30 commit 16f60cedb31d3c7a6aa160d8f00df1825ce32ed5
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/parallel/test-http-incoming-message-connection-setter.js
@@ -0,0 +1,18 @@
'use strict';

// Test that the setter for http.IncomingMessage,prototype.connection sets the
// socket property too.
require('../common');

const assert = require('assert');
const http = require('http');

const incomingMessage = new http.IncomingMessage();

assert.strictEqual(incomingMessage.connection, undefined);
assert.strictEqual(incomingMessage.socket, undefined);

incomingMessage.connection = 'fhqwhgads';

assert.strictEqual(incomingMessage.connection, 'fhqwhgads');
assert.strictEqual(incomingMessage.socket, 'fhqwhgads');

0 comments on commit 16f60ce

Please sign in to comment.
You can’t perform that action at this time.