node/test/parallel/test-listen-fd-ebadf.js
Richard Karmazin 00ea286800 test: refactor test-listen-fd-ebadf
Replace var with const and assert.equal with assert.strictEqual.

PR-URL: https://github.com/nodejs/node/pull/10034
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-12-07 06:45:23 -06:00

14 lines
358 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const net = require('net');
net.createServer(common.fail).listen({fd: 2})
.on('error', common.mustCall(onError));
net.createServer(common.fail).listen({fd: 42})
.on('error', common.mustCall(onError));
function onError(ex) {
assert.strictEqual(ex.code, 'EINVAL');
}