Skip to content

Commit

Permalink
test: change callback function to arrow function
Browse files Browse the repository at this point in the history
PR-URL: #17699
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
skanamaru authored and MylesBorins committed Feb 11, 2018
1 parent 244d569 commit 6981fda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-http-date-header.js
Expand Up @@ -5,7 +5,7 @@ const http = require('http');

const testResBody = 'other stuff!\n';

const server = http.createServer(function(req, res) {
const server = http.createServer((req, res) => {
assert.ok(!('date' in req.headers),
'Request headers contained a Date.');
res.writeHead(200, {
Expand All @@ -16,16 +16,16 @@ const server = http.createServer(function(req, res) {
server.listen(0);


server.addListener('listening', function() {
server.addListener('listening', () => {
const options = {
port: this.address().port,
port: server.address().port,
path: '/',
method: 'GET'
};
const req = http.request(options, function(res) {
const req = http.request(options, (res) => {
assert.ok('date' in res.headers,
'Response headers didn\'t contain a Date.');
res.addListener('end', function() {
res.addListener('end', () => {
server.close();
process.exit();
});
Expand Down

0 comments on commit 6981fda

Please sign in to comment.