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
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 targos committed Jun 19, 2017
1 parent ffdcfff commit 917e579
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 917e579

Please sign in to comment.