Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
20 lines
478 B
JavaScript
20 lines
478 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
const server = http.createServer();
|
|
server.on('request', function(req, res) {
|
|
assert(req.headers['foo'], 'bar');
|
|
res.end('ok');
|
|
server.close();
|
|
});
|
|
server.listen(common.PORT, '127.0.0.1', function() {
|
|
let req = http.request({
|
|
method: 'GET',
|
|
host: '127.0.0.1',
|
|
port: common.PORT,
|
|
});
|
|
req.setHeader('foo', 'bar');
|
|
req.flushHeaders();
|
|
});
|