Skip to content

Commit bae695f

Browse files
Sam Shullitaloacasas
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 <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1e98ea3 commit bae695f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
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)