Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5a2cff

Browse filesBrowse files
kjunichigibfahn
authored andcommitted
test: replace function with ES6 arrow function
PR-URL: #17306 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
1 parent 97888e0 commit f5a2cff
Copy full SHA for f5a2cff

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http-pause.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-pause.js
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ let resultServer = '';
2929
const expectedClient = 'Response Body from Server';
3030
let resultClient = '';
3131

32-
const server = http.createServer(function(req, res) {
32+
const server = http.createServer((req, res) => {
3333
console.error('pause server request');
3434
req.pause();
35-
setTimeout(function() {
35+
setTimeout(() => {
3636
console.error('resume server request');
3737
req.resume();
3838
req.setEncoding('utf8');
39-
req.on('data', function(chunk) {
39+
req.on('data', (chunk) => {
4040
resultServer += chunk;
4141
});
42-
req.on('end', function() {
42+
req.on('end', () => {
4343
console.error(resultServer);
4444
res.writeHead(200);
4545
res.end(expectedClient);
@@ -52,16 +52,16 @@ server.listen(0, function() {
5252
port: this.address().port,
5353
path: '/',
5454
method: 'POST'
55-
}, function(res) {
55+
}, (res) => {
5656
console.error('pause client response');
5757
res.pause();
58-
setTimeout(function() {
58+
setTimeout(() => {
5959
console.error('resume client response');
6060
res.resume();
61-
res.on('data', function(chunk) {
61+
res.on('data', (chunk) => {
6262
resultClient += chunk;
6363
});
64-
res.on('end', function() {
64+
res.on('end', () => {
6565
console.error(resultClient);
6666
server.close();
6767
});
@@ -70,7 +70,7 @@ server.listen(0, function() {
7070
req.end(expectedServer);
7171
});
7272

73-
process.on('exit', function() {
73+
process.on('exit', () => {
7474
assert.strictEqual(expectedServer, resultServer);
7575
assert.strictEqual(expectedClient, resultClient);
7676
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.