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 Jan 9, 2018
1 parent bdddb82 commit a9d83ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-http-date-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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 @@ -37,16 +37,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 a9d83ce

Please sign in to comment.