diff --git a/test/simple/test-net-listen-fd0.js b/test/simple/test-net-listen-fd0.js index ba0d59841930..ac5896ee8f99 100644 --- a/test/simple/test-net-listen-fd0.js +++ b/test/simple/test-net-listen-fd0.js @@ -26,11 +26,15 @@ var net = require('net'); var gotError = false; process.on('exit', function() { - assert.equal(gotError, true); + assert(gotError instanceof Error); }); // this should fail with an async EINVAL error, not throw an exception net.createServer(assert.fail).listen({fd:0}).on('error', function(e) { - assert.equal(e.code, 'EINVAL'); - gotError = true; + switch(e.code) { + case 'EINVAL': + case 'ENOTSOCK': + gotError = e; + break + } });