From 58c0078f2b6ae2d5817dcea43d5a91f2e6c3cd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 26 Nov 2016 10:28:18 +0100 Subject: [PATCH] test: fix test-buffer-slow Fix incorrect use of string instead of RegExp in `throws` assertions. --- test/parallel/test-buffer-slow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 24bd9e1cfd314d..cecc01a95923c3 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -51,10 +51,10 @@ assert.strictEqual(SlowBuffer('string').length, 0); // should throw with invalid length assert.throws(function() { SlowBuffer(Infinity); -}, 'invalid Buffer length'); +}, /^RangeError: Invalid array buffer length$/); assert.throws(function() { SlowBuffer(-1); -}, 'invalid Buffer length'); +}, /^RangeError: Invalid array buffer length$/); assert.throws(function() { SlowBuffer(buffer.kMaxLength + 1); -}, 'invalid Buffer length'); +}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);