mirror of https://github.com/lukechilds/node.git
Browse Source
Covert lib/net.js over to using lib/internal/errors.js - Replace thrown errors in lib/net.js with errors from lib/internal/errors. The ERR_INVALID_OPT_VALUE error have been used in the Server.prototype.listen() method - Update tests according to the above modifications PR-URL: https://github.com/nodejs/node/pull/14782 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>v9.x-staging
matzavinos
7 years ago
committed by
Joyee Cheung
15 changed files with 168 additions and 125 deletions
@ -1,9 +1,16 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
const net = require('net'); |
|||
|
|||
assert.throws(function() { net.createServer('path'); }, |
|||
/^TypeError: options must be an object$/); |
|||
common.expectsError({ |
|||
code: 'ERR_INVALID_ARG_TYPE', |
|||
type: TypeError |
|||
})); |
|||
|
|||
assert.throws(function() { net.createServer(0); }, |
|||
/^TypeError: options must be an object$/); |
|||
common.expectsError({ |
|||
code: 'ERR_INVALID_ARG_TYPE', |
|||
type: TypeError |
|||
})); |
|||
|
Loading…
Reference in new issue