mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02: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:
parent
e7af9830e9
commit
c208135055
2 changed files with 16 additions and 7 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue