diff options
author | starkwang <381152119@qq.com> | 2017-06-28 23:58:39 -0400 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2017-07-12 17:00:30 -0400 |
commit | dbfe8c4ea2fb30f7d3dc4f8e361e3059b0e1e50f (patch) | |
tree | 35c3e4c7942fcb826e19f7a9eead918f9caa805b /test/parallel/test-buffer-fill.js | |
parent | 1562fb9ea7b993382a4aef0433a10b1029419f17 (diff) | |
download | android-node-v8-dbfe8c4ea2fb30f7d3dc4f8e361e3059b0e1e50f.tar.gz android-node-v8-dbfe8c4ea2fb30f7d3dc4f8e361e3059b0e1e50f.tar.bz2 android-node-v8-dbfe8c4ea2fb30f7d3dc4f8e361e3059b0e1e50f.zip |
errors,buffer: port errors to internal/errors
PR-URL: https://github.com/nodejs/node/pull/13976
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'test/parallel/test-buffer-fill.js')
-rw-r--r-- | test/parallel/test-buffer-fill.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/parallel/test-buffer-fill.js b/test/parallel/test-buffer-fill.js index d73aa006a9..eb3629f954 100644 --- a/test/parallel/test-buffer-fill.js +++ b/test/parallel/test-buffer-fill.js @@ -206,16 +206,30 @@ assert.throws( common.expectsError({code: 'ERR_INDEX_OUT_OF_RANGE'})); assert.throws( () => buf1.fill('a', 0, buf1.length, 'node rocks!'), - /^TypeError: Unknown encoding: node rocks!$/); + common.expectsError({ + code: 'ERR_UNKNOWN_ENCODING', + type: TypeError, + message: 'Unknown encoding: node rocks!' + })); assert.throws( () => buf1.fill('a', 0, 0, NaN), - /^TypeError: encoding must be a string$/); + common.expectsError({ + code: 'ERR_INVALID_ARG_TYPE', + message: 'The "encoding" argument must be of type string' + })); assert.throws( () => buf1.fill('a', 0, 0, null), - /^TypeError: encoding must be a string$/); + common.expectsError({ + code: 'ERR_INVALID_ARG_TYPE', + message: 'The "encoding" argument must be of type string' + })); assert.throws( () => buf1.fill('a', 0, 0, 'foo'), - /^TypeError: Unknown encoding: foo$/); + common.expectsError({ + code: 'ERR_UNKNOWN_ENCODING', + type: TypeError, + message: 'Unknown encoding: foo' + })); function genBuffer(size, args) { |