Skip to content

Commit

Permalink
test: add regex check in test-buffer-bad-overload
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sam Shull authored and italoacasas committed Dec 22, 2016
1 parent 1e98ea3 commit bae695f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-bad-overload.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assert.doesNotThrow(function() {

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

assert.doesNotThrow(function() {
Buffer.from('deadbeaf', 'hex');
Expand Down

0 comments on commit bae695f

Please sign in to comment.