Skip to content

Commit c309bb0

Browse files
Sebastian RoederMylesBorins
Sebastian Roeder
authored andcommitted
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>
1 parent 62c5680 commit c309bb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-buffer-equals.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ assert.ok(!c.equals(d));
1313
assert.ok(!d.equals(e));
1414
assert.ok(d.equals(d));
1515

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

0 commit comments

Comments
 (0)