GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: improve test-net-socket-timeout · nodejs/node@1dff257

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-net-socket-timeout.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-net-socket-timeout.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-socket-timeout.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ const validDelays = [0, 0.001, 1, 1e6];
3434

3535

3636
for (let i = 0; i < nonNumericDelays.length; i++) {
37-
assert.throws(function() {
37+
assert.throws(() => {
3838
s.setTimeout(nonNumericDelays[i], () => {});
39-
}, TypeError, nonNumericDelays[i]);
39+
}, { code: 'ERR_INVALID_ARG_TYPE' }, nonNumericDelays[i]);
4040
}
4141

4242
for (let i = 0; i < badRangeDelays.length; i++) {
43-
assert.throws(function() {
43+
assert.throws(() => {
4444
s.setTimeout(badRangeDelays[i], () => {});
45-
}, RangeError, badRangeDelays[i]);
45+
}, { code: 'ERR_OUT_OF_RANGE' }, badRangeDelays[i]);
4646
}
4747

4848
for (let i = 0; i < validDelays.length; i++) {
4949
s.setTimeout(validDelays[i], () => {});
5050
}
5151

5252
const server = net.Server();
53-
server.listen(0, common.mustCall(function() {
54-
const socket = net.createConnection(this.address().port);
55-
socket.setTimeout(1, common.mustCall(function() {
53+
server.listen(0, common.mustCall(() => {
54+
const socket = net.createConnection(server.address().port);
55+
socket.setTimeout(1, common.mustCall(() => {
5656
socket.destroy();
5757
server.close();
5858
}));

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.