Skip to content

Commit

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

PR-URL: #11215
Backport-PR-URL: #13785
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
  • Loading branch information
Sebastian Roeder authored and gibfahn committed Jun 20, 2017
1 parent e81401a commit bcfeed2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-buffer-equals.js
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 bcfeed2

Please sign in to comment.