mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
1 parent
1e98ea3f5e
commit
bae695f4f3
1 file changed
+1
-1
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user