Skip to content

Commit

Permalink
test: validate error message from buffer.equals
Browse files Browse the repository at this point in the history
Adding regular expression as an argument to an assert.throws().

PR-URL: #11215
Backport-PR-URL: #13785
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
  • Loading branch information
Sebastian Roeder authored and gibfahn committed Jun 19, 2017
1 parent da1a86c commit 1e889b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-buffer-equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/);

0 comments on commit 1e889b8

Please sign in to comment.