-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add comments explaining _setSimultaneousAccepts deprecation tests
PR-URL: #41307 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
- Loading branch information
1 parent
ffca1a7
commit 8d15bac
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |