Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: revert two test and add comments for each
  • Loading branch information
kuriyosh committed Dec 26, 2021
commit c23d0e622a2e265e405d877497ef0c79b2eb6cca
19 changes: 19 additions & 0 deletions test/parallel/test-net-deprecated-setsimultaneousaccepts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Flags: --no-warnings
'use strict';

// This test checks that `_setSimultaneousAccepts` emit DEP0121 warning.
// Ref test-net-server-simultaneous-accepts-produce-warning-once.js
Copy link
Copy Markdown
Member

@Trott Trott Dec 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This test checks that `_setSimultaneousAccepts` emit DEP0121 warning.
// Ref test-net-server-simultaneous-accepts-produce-warning-once.js
// Test that DEP0121 is emitted on the first call of _setSimultaneousAccepts().


const {
expectWarning
} = require('../common');
const {
_setSimultaneousAccepts
} = require('net');

expectWarning(
'DeprecationWarning',
'net._setSimultaneousAccepts() is deprecated and will be removed.',
'DEP0121');

_setSimultaneousAccepts();
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use strict';

const { expectWarning, mustCall, mustNotCall } = require('../common');
const net = require('net');
// This test checks that `_setSimultaneousAccepts` does not emit DEP0121 warning
// in second calling, by combination with
// `test-net-deprecated-setsimultaneousaccepts.js`.
Comment thread
kuriyosh marked this conversation as resolved.
Outdated

const { expectWarning } = require('../common');
const { _setSimultaneousAccepts } = require('net');

expectWarning(
'DeprecationWarning',
'net._setSimultaneousAccepts() is deprecated and will be removed.',
'DEP0121');

Comment thread
Trott marked this conversation as resolved.
process.on('warning', mustCall(() => {
process.on('warning', mustNotCall());
}));
net._setSimultaneousAccepts();
net._setSimultaneousAccepts();
_setSimultaneousAccepts();
_setSimultaneousAccepts();