Skip to content

Commit f1cc0a4

Browse files
Sam Shullevanlucas
Sam Shull
authored andcommitted
test: add regex check in test-buffer-bad-overload
Creating a buffer from a number should throw an error with a message that describes the issue. PR-URL: #10038 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0684211 commit f1cc0a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-buffer-bad-overload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assert.doesNotThrow(function() {
88

99
assert.throws(function() {
1010
Buffer.from(10, 'hex');
11-
});
11+
}, /^TypeError: "value" argument must not be a number$/);
1212

1313
assert.doesNotThrow(function() {
1414
Buffer.from('deadbeaf', 'hex');

0 commit comments

Comments
 (0)