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 evanlucas committed Jan 4, 2017
1 parent 0684211 commit f1cc0a4
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 f1cc0a4

Please sign in to comment.