mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: more common.mustNotCall in net, tls
PR-URL: https://github.com/nodejs/node/pull/57246 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This commit is contained in:
parent
97cbefabd9
commit
208f07adda
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user