diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-02-27 14:55:32 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-05 19:51:30 +0100 |
commit | 1e8d110e640c658e4f6ed7540db62d063269ba6c (patch) | |
tree | afe2636b1b190fee00006beaa484fa77d5949770 /test | |
parent | 023f49c5a938ef631260b76876155eaf957084be (diff) | |
download | android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.gz android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.bz2 android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.zip |
lib: port errors to new system
This is a first batch of updates that touches non-underscored modules in
lib.
PR-URL: https://github.com/nodejs/node/pull/19034
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-child-process-spawnsync-validation-errors.js | 18 | ||||
-rw-r--r-- | test/parallel/test-module-loading-error.js | 2 | ||||
-rw-r--r-- | test/parallel/test-net-server-listen-options.js | 2 |
3 files changed, 10 insertions, 12 deletions
diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js index 433e0fce16..802acad103 100644 --- a/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -8,10 +8,10 @@ let invalidArgTypeError; if (common.isWindows) { invalidArgTypeError = - common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 36); + common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 42); } else { invalidArgTypeError = - common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 56); + common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 62); } const invalidRangeError = @@ -127,18 +127,16 @@ if (!common.isWindows) { { // Validate the windowsHide option - const err = /^TypeError: "windowsHide" must be a boolean$/; - pass('windowsHide', undefined); pass('windowsHide', null); pass('windowsHide', true); pass('windowsHide', false); - fail('windowsHide', 0, err); - fail('windowsHide', 1, err); - fail('windowsHide', __dirname, err); - fail('windowsHide', [], err); - fail('windowsHide', {}, err); - fail('windowsHide', common.mustNotCall(), err); + fail('windowsHide', 0, invalidArgTypeError); + fail('windowsHide', 1, invalidArgTypeError); + fail('windowsHide', __dirname, invalidArgTypeError); + fail('windowsHide', [], invalidArgTypeError); + fail('windowsHide', {}, invalidArgTypeError); + fail('windowsHide', common.mustNotCall(), invalidArgTypeError); } { diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 811d7d5ded..86932bd759 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -74,7 +74,7 @@ const re = /^The "id" argument must be of type string\. Received type \w+$/; common.expectsError( () => { require(''); }, { - type: Error, + type: TypeError, code: 'ERR_INVALID_ARG_VALUE', message: 'The argument \'id\' must be a non-empty string. Received \'\'' }); diff --git a/test/parallel/test-net-server-listen-options.js b/test/parallel/test-net-server-listen-options.js index 8398484438..4f7a6bd28f 100644 --- a/test/parallel/test-net-server-listen-options.js +++ b/test/parallel/test-net-server-listen-options.js @@ -60,7 +60,7 @@ const listenOnPort = [ common.expectsError(block, { code: 'ERR_INVALID_OPT_VALUE', - type: Error, + type: TypeError, message: /^The value "{.*}" is invalid for option "options"$/ }); } |