Browse Source

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: https://github.com/nodejs/node/pull/10038
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6.x
Sam Shull 8 years ago
committed by Michaël Zasso
parent
commit
aba15fb9f2
  1. 2
      test/parallel/test-buffer-bad-overload.js

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

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

Loading…
Cancel
Save