From bcfeed2e51ee0c9ea7656f34b714bfbbf995be9b Mon Sep 17 00:00:00 2001 From: Sebastian Roeder Date: Tue, 7 Feb 2017 06:38:45 -0800 Subject: [PATCH] test: validate error message from buffer.equals Adding regular expression as an argument to an assert.throws(). PR-URL: https://github.com/nodejs/node/pull/11215 Backport-PR-URL: https://github.com/nodejs/node/pull/13785 Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Yuta Hiroto --- test/parallel/test-buffer-equals.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-equals.js b/test/parallel/test-buffer-equals.js index 2b460c5c6aea1b..3851f05c7b9a6d 100644 --- a/test/parallel/test-buffer-equals.js +++ b/test/parallel/test-buffer-equals.js @@ -13,4 +13,5 @@ assert.ok(!c.equals(d)); assert.ok(!d.equals(e)); assert.ok(d.equals(d)); -assert.throws(() => Buffer.alloc(1).equals('abc')); +assert.throws(() => Buffer.alloc(1).equals('abc'), + /^TypeError: Argument must be a Buffer$/);