From b2a87f770dfe66a660d1da2de7c6d48f23d9fb87 Mon Sep 17 00:00:00 2001 From: Yoshiki Kurihara Date: Mon, 27 Dec 2021 23:20:24 +0900 Subject: [PATCH] test: add comments explaining _setSimultaneousAccepts deprecation tests PR-URL: https://github.com/nodejs/node/pull/41307 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel --- .../test-net-deprecated-setsimultaneousaccepts.js | 2 ++ ...ver-simultaneous-accepts-produce-warning-once.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js b/test/parallel/test-net-deprecated-setsimultaneousaccepts.js index 3778a9650fcc8d..dd6decdcce513f 100644 --- a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js +++ b/test/parallel/test-net-deprecated-setsimultaneousaccepts.js @@ -1,6 +1,8 @@ // Flags: --no-warnings 'use strict'; +// Test that DEP0121 is emitted on the first call of _setSimultaneousAccepts(). + const { expectWarning } = require('../common'); diff --git a/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js b/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js index ffca38f603b2a9..391c2ecea76841 100644 --- a/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js +++ b/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js @@ -1,12 +1,19 @@ 'use strict'; +// Test that DEP0121 is emitted only once if _setSimultaneousAccepts() is called +// more than once. This test is similar to +// test-net-deprecated-setsimultaneousaccepts.js, but that test calls +// _setSimultaneousAccepts() only once. Unlike this test, that will confirm +// that the warning is emitted on the first call. This test doesn't check which +// call caused the warning to be emitted. + const { expectWarning } = require('../common'); -const net = require('net'); +const { _setSimultaneousAccepts } = require('net'); expectWarning( 'DeprecationWarning', 'net._setSimultaneousAccepts() is deprecated and will be removed.', 'DEP0121'); -net._setSimultaneousAccepts(); -net._setSimultaneousAccepts(); +_setSimultaneousAccepts(); +_setSimultaneousAccepts();