mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 05:11:49 +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>
19 lines
444 B
JavaScript
19 lines
444 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var TCP = process.binding('tcp_wrap').TCP;
|
|
var uv = process.binding('uv');
|
|
|
|
var handle = new TCP();
|
|
|
|
// Should be able to bind to the common.PORT
|
|
var err = handle.bind('0.0.0.0', common.PORT);
|
|
assert.equal(err, 0);
|
|
|
|
// Should not be able to bind to the same port again
|
|
err = handle.bind('0.0.0.0', common.PORT);
|
|
assert.equal(err, uv.UV_EINVAL);
|
|
|
|
handle.close();
|