Skip to content

Commit

Permalink
test: increase coverage for _http_incoming.js
Browse files Browse the repository at this point in the history
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 Jan 3, 2020
1 parent b8ccf30 commit 16f60ce
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-http-incoming-message-connection-setter.js
Original file line number Diff line number Diff line change
@@ -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.