diff options
author | Mithun Sasidharan <mithunsasidharan89@gmail.com> | 2017-12-06 22:16:44 +0530 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-08 16:02:07 -0500 |
commit | eae0c05697121aaae4b097f34d30a259c8591af1 (patch) | |
tree | 5a249a64f5309a1865e6f1540a39264eb7b898f9 /test/parallel/test-process-hrtime.js | |
parent | 20d6b8c6c01c09a51f503f7f8a0fee494be6f742 (diff) | |
download | android-node-v8-eae0c05697121aaae4b097f34d30a259c8591af1.tar.gz android-node-v8-eae0c05697121aaae4b097f34d30a259c8591af1.tar.bz2 android-node-v8-eae0c05697121aaae4b097f34d30a259c8591af1.zip |
test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17498
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Diffstat (limited to 'test/parallel/test-process-hrtime.js')
-rw-r--r-- | test/parallel/test-process-hrtime.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index 5ca9be72d1..1d2d2ecde9 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -33,34 +33,34 @@ validateTuple(tuple); validateTuple(process.hrtime(tuple)); // test that only an Array may be passed to process.hrtime() -assert.throws(() => { +common.expectsError(() => { process.hrtime(1); -}, common.expectsError({ +}, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "time" argument must be of type Array. Received type number' -})); -assert.throws(() => { +}); +common.expectsError(() => { process.hrtime([]); -}, common.expectsError({ +}, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, message: 'The array "time" (length 0) must be of length 2.' -})); -assert.throws(() => { +}); +common.expectsError(() => { process.hrtime([1]); -}, common.expectsError({ +}, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, message: 'The array "time" (length 1) must be of length 2.' -})); -assert.throws(() => { +}); +common.expectsError(() => { process.hrtime([1, 2, 3]); -}, common.expectsError({ +}, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, message: 'The array "time" (length 3) must be of length 2.' -})); +}); function validateTuple(tuple) { assert(Array.isArray(tuple)); |