mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 04:59:52 +00:00

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>
36 lines
724 B
JavaScript
36 lines
724 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var net = require('net');
|
|
|
|
var gotError = false;
|
|
var gotWriteCB = false;
|
|
|
|
process.on('exit', function() {
|
|
assert(gotError);
|
|
assert(gotWriteCB);
|
|
});
|
|
|
|
var server = net.createServer(function(socket) {
|
|
socket.resume();
|
|
|
|
socket.on('error', function(error) {
|
|
console.error('got error, closing server', error);
|
|
server.close();
|
|
gotError = true;
|
|
});
|
|
|
|
setTimeout(function() {
|
|
console.error('about to try to write');
|
|
socket.write('test', function(e) {
|
|
gotWriteCB = true;
|
|
});
|
|
}, 250);
|
|
});
|
|
|
|
server.listen(common.PORT, function() {
|
|
var client = net.connect(common.PORT, function() {
|
|
client.end();
|
|
});
|
|
});
|