summaryrefslogtreecommitdiff
path: root/test/parallel/test-net-listen-fd0.js
blob: ce7d11a992ba4608744068538a1c89f1afc67862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';
const common = require('../common');
const assert = require('assert');
const net = require('net');

// This should fail with an async EINVAL error, not throw an exception
net.createServer(common.mustNotCall())
  .listen({fd: 0})
  .on('error', common.mustCall(function(e) {
    assert(e instanceof Error);
    assert(['EINVAL', 'ENOTSOCK'].includes(e.code));
  }));