Skip to content
Browse files

test: validate error message from buffer.equals

Adding regular expression as an argument to an assert.throws().

PR-URL: #11215
Reviewed-By: Colin Ihrig <>
Reviewed-By: Joyee Cheung <>
Reviewed-By: James M Snell <>
Reviewed-By: Yuta Hiroto <>
  • Loading branch information
Sebastian Roeder authored and hiroppy committed Feb 11, 2017
1 parent b32ae9e commit f8cdaaa16ad01b946c7528c473f7fb80cfbeb3a2
Showing with 2 additions and 1 deletion.
  1. +2 −1 test/parallel/test-buffer-equals.js
@@ -14,4 +14,5 @@ assert.ok(!d.equals(e));
assert.ok(d.equals(new Uint8Array([0x61, 0x62, 0x63, 0x64, 0x65])));

assert.throws(() => Buffer.alloc(1).equals('abc'));
assert.throws(() => Buffer.alloc(1).equals('abc'),
/^TypeError: Argument must be a Buffer or Uint8Array$/);

0 comments on commit f8cdaaa

Please sign in to comment.
You can’t perform that action at this time.