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 — doc: replace anonymous function with arrow function · nodejs/node@f80e7a1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/guides
    • writing-tests.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/guides/writing-tests.md‎

Copy file name to clipboardExpand all lines: doc/guides/writing-tests.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
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 (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.