mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: check codes of thrown errors
PR-URL: https://github.com/nodejs/node/pull/23519 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: George Adams <george.adams@uk.ibm.com>
This commit is contained in:
1 parent
f1fc05b45c
commit
232fe58a4c
2 files changed
+16
-7
No files matched your search
@@ -40,7 +40,12 @@ assert.throws(function() {
|
||||
Object.setPrototypeOf(AB, ArrayBuffer);
|
||||
Object.setPrototypeOf(AB.prototype, ArrayBuffer.prototype);
|
||||
Buffer.from(new AB());
|
||||
}, TypeError);
|
||||
}, {
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
name: 'TypeError [ERR_INVALID_ARG_TYPE]',
|
||||
message: 'The first argument must be one of type string, Buffer,' +
|
||||
' ArrayBuffer, Array, or Array-like Object. Received type object'
|
||||
});
|
||||
|
||||
// Test the byteOffset and length arguments
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user