diff options
author | yuriettys <yres.101@gmail.com> | 2018-11-24 17:00:46 +0900 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2018-11-24 11:33:37 +0200 |
commit | 6e4502c635d1e8b3fea514c2eac54a7d75780e6e (patch) | |
tree | 4cf79254e3bf2b2b0ddf1d11a2eaacae0789b53d /doc/guides | |
parent | 83a7247f12feb4f4d8ee558ad2c1528d26b503e0 (diff) | |
download | android-node-v8-6e4502c635d1e8b3fea514c2eac54a7d75780e6e.tar.gz android-node-v8-6e4502c635d1e8b3fea514c2eac54a7d75780e6e.tar.bz2 android-node-v8-6e4502c635d1e8b3fea514c2eac54a7d75780e6e.zip |
doc: replace anonymous function with arrow function
PR-URL: https://github.com/nodejs/node/pull/24627
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Diffstat (limited to 'doc/guides')
-rw-r--r-- | doc/guides/writing-tests.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index 260dfa236f..cc06238466 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -168,7 +168,7 @@ process.on('exit', function() { assert.equal(response, 1, 'http request "response" callback was not called'); }); -const server = http.createServer(function(req, res) { +const server = http.createServer((req, res) => { request++; res.end(); }).listen(0, function() { @@ -176,7 +176,7 @@ const server = http.createServer(function(req, res) { agent: null, port: this.address().port }; - http.get(options, function(res) { + http.get(options, (res) => { response++; res.resume(); server.close(); @@ -191,14 +191,14 @@ This test could be greatly simplified by using `common.mustCall` like this: const common = require('../common'); const http = require('http'); -const server = http.createServer(common.mustCall(function(req, res) { +const server = http.createServer(common.mustCall((req, res) => { res.end(); })).listen(0, function() { const options = { agent: null, port: this.address().port }; - http.get(options, common.mustCall(function(res) { + http.get(options, common.mustCall((res) => { res.resume(); server.close(); })); |