Skip to content

Commit 4093572

Browse files
AjidoBethGriggs
authored andcommitted
test: add test for socket.end callback
PR-URL: #24087 Refs: #23937 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f9933ff commit 4093572

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
constcommon=require('../common');
4+
constnet=require('net');
5+
6+
constserver=net.createServer((socket)=>{
7+
socket.resume();
8+
}).unref();
9+
10+
server.listen(common.mustCall(()=>{
11+
constconnect=(...args)=>{
12+
constsocket=net.createConnection(server.address().port,()=>{
13+
socket.end(...args);
14+
});
15+
};
16+
17+
constcb=common.mustCall(()=>{},3);
18+
19+
connect(cb);
20+
connect('foo',cb);
21+
connect('foo','utf8',cb);
22+
}));

0 commit comments

Comments
 (0)