Skip to content

test: more common.mustNotCall in net #57246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/parallel/test-net-eaddrinuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ const common = require('../common');
const assert = require('assert');
const net = require('net');

const server1 = net.createServer(function(socket) {
});
const server2 = net.createServer(function(socket) {
});
const server1 = net.createServer(common.mustNotCall());
const server2 = net.createServer(common.mustNotCall());
server1.listen(0, common.mustCall(function() {
server2.on('error', function(error) {
assert.strictEqual(error.message.includes('EADDRINUSE'), true);
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-net-listen-close-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
const common = require('../common');
const net = require('net');

const server = net.createServer(function(socket) {
});
const server = net.createServer(common.mustNotCall());
server.listen(0, common.mustNotCall());
server.on('error', common.mustNotCall());
server.close();
3 changes: 1 addition & 2 deletions test/parallel/test-net-listen-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
const common = require('../common');
const net = require('net');

const server = net.createServer(function(socket) {
});
const server = net.createServer(common.mustNotCall());
server.listen(1, '1.1.1.1', common.mustNotCall()); // EACCES or EADDRNOTAVAIL
server.on('error', common.mustCall());
3 changes: 1 addition & 2 deletions test/parallel/test-tls-close-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const fixtures = require('../common/fixtures');
const server = tls.createServer({
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
}, function(c) {
}).listen(0, common.mustCall(function() {
}, common.mustNotCall()).listen(0, common.mustCall(function() {
const c = tls.connect(this.address().port, common.mustNotCall());

c.on('error', common.mustCall());
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-tls-handshake-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const server = tls.createServer({
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem'),
rejectUnauthorized: true
}, function(c) {
}).listen(0, common.mustCall(function() {
}, common.mustNotCall()).listen(0, common.mustCall(function() {
assert.throws(() => {
tls.connect({
port: this.address().port,
Expand Down
Loading