From f1cc0a4d2623863291f1b987583e2f29565b2bdc Mon Sep 17 00:00:00 2001 From: Sam Shull Date: Thu, 1 Dec 2016 09:49:28 -0800 Subject: [PATCH] test: add regex check in test-buffer-bad-overload Creating a buffer from a number should throw an error with a message that describes the issue. PR-URL: https://github.com/nodejs/node/pull/10038 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-buffer-bad-overload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-bad-overload.js b/test/parallel/test-buffer-bad-overload.js index 3d99dd532e9b93..d5626e16d14419 100644 --- a/test/parallel/test-buffer-bad-overload.js +++ b/test/parallel/test-buffer-bad-overload.js @@ -8,7 +8,7 @@ assert.doesNotThrow(function() { assert.throws(function() { Buffer.from(10, 'hex'); -}); +}, /^TypeError: "value" argument must not be a number$/); assert.doesNotThrow(function() { Buffer.from('deadbeaf', 'hex');