Skip to content

Commit 16f60ce

Browse files
TrottBridgeAR
authored andcommitted
test: increase coverage for _http_incoming.js
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]>
1 parent b8ccf30 commit 16f60ce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
// Test that the setter for http.IncomingMessage,prototype.connection sets the
4+
// socket property too.
5+
require('../common');
6+
7+
const assert = require('assert');
8+
const http = require('http');
9+
10+
const incomingMessage = new http.IncomingMessage();
11+
12+
assert.strictEqual(incomingMessage.connection, undefined);
13+
assert.strictEqual(incomingMessage.socket, undefined);
14+
15+
incomingMessage.connection = 'fhqwhgads';
16+
17+
assert.strictEqual(incomingMessage.connection, 'fhqwhgads');
18+
assert.strictEqual(incomingMessage.socket, 'fhqwhgads');

0 commit comments

Comments
 (0)