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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
  • 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.