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>
22 lines
489 B
JavaScript
22 lines
489 B
JavaScript
'use strict';
|
|
var assert = require('assert');
|
|
var common = require('../common');
|
|
var dgram = require('dgram');
|
|
|
|
var buf = new Buffer(1024);
|
|
buf.fill(42);
|
|
|
|
var socket = dgram.createSocket('udp4');
|
|
var closeEvents = 0;
|
|
socket.send(buf, 0, buf.length, common.PORT, 'localhost');
|
|
|
|
// if close callback is not function, ignore the argument.
|
|
socket.close('bad argument');
|
|
|
|
socket.on('close', function() {
|
|
++closeEvents;
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(closeEvents, 1);
|
|
});
|