node/test/parallel/test-net-socket-no-halfopen-enforcer.js
Antoine du Hamel 4a4fdcf390
test: ensure assertions are reached on more tests
PR-URL: https://github.com/nodejs/node/pull/60761
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-11-24 23:47:52 +01:00

12 lines
320 B
JavaScript

'use strict';
require('../common');
// This test ensures that `net.Socket` does not inherit the no-half-open
// enforcer from `stream.Duplex`.
const { Socket } = require('net');
const assert = require('assert');
const socket = new Socket({ allowHalfOpen: false });
assert.strictEqual(socket.listenerCount('end'), 1);