Skip to content

Commit f80e7a1

Browse files
yuriettysrvagg
authored andcommitted
doc: replace anonymous function with arrow function
PR-URL: #24627 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
1 parent 1067653 commit f80e7a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/guides/writing-tests.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ process.on('exit', function() {
168168
assert.equal(response, 1, 'http request "response" callback was not called');
169169
});
170170

171-
const server = http.createServer(function(req, res) {
171+
const server = http.createServer((req, res) => {
172172
request++;
173173
res.end();
174174
}).listen(0, function() {
175175
const options = {
176176
agent: null,
177177
port: this.address().port
178178
};
179-
http.get(options, function(res) {
179+
http.get(options, (res) => {
180180
response++;
181181
res.resume();
182182
server.close();
@@ -191,14 +191,14 @@ This test could be greatly simplified by using `common.mustCall` like this:
191191
const common = require('../common');
192192
const http = require('http');
193193

194-
const server = http.createServer(common.mustCall(function(req, res) {
194+
const server = http.createServer(common.mustCall((req, res) => {
195195
res.end();
196196
})).listen(0, function() {
197197
const options = {
198198
agent: null,
199199
port: this.address().port
200200
};
201-
http.get(options, common.mustCall(function(res) {
201+
http.get(options, common.mustCall((res) => {
202202
res.resume();
203203
server.close();
204204
}));

0 commit comments

Comments
 (0)