diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-08 16:41:38 -0500 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-11 18:21:58 -0500 |
commit | 094bfaf769f5b6bc8ca6fbcc289cdf5e0f07073f (patch) | |
tree | 5fa840b303201b1f5375302bbf06cedc42f5a5c0 /test/parallel/test-buffer-alloc.js | |
parent | 4df7c190bf449e3d0d8877f45bb7490d7a801118 (diff) | |
download | android-node-v8-094bfaf769f5b6bc8ca6fbcc289cdf5e0f07073f.tar.gz android-node-v8-094bfaf769f5b6bc8ca6fbcc289cdf5e0f07073f.tar.bz2 android-node-v8-094bfaf769f5b6bc8ca6fbcc289cdf5e0f07073f.zip |
test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17557
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-buffer-alloc.js')
-rw-r--r-- | test/parallel/test-buffer-alloc.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 272f8c20e1..4d16f1ba3d 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -974,12 +974,11 @@ assert.strictEqual(SlowBuffer.prototype.offset, undefined); } // ParseArrayIndex() should reject values that don't fit in a 32 bits size_t. -assert.throws(() => { +common.expectsError(() => { const a = Buffer.alloc(1); const b = Buffer.alloc(1); a.copy(b, 0, 0x100000000, 0x100000001); -}, common.expectsError( - { code: undefined, type: RangeError, message: 'Index out of range' })); +}, { code: undefined, type: RangeError, message: 'Index out of range' }); // Unpooled buffer (replaces SlowBuffer) { |