@@ -967,12 +967,16 @@ common.expectsError(
967
967
message : 'argument must be a buffer'
968
968
} ) ;
969
969
970
- const regErrorMsg =
971
- new RegExp ( 'The first argument must be one of type string, Buffer, ' +
972
- 'ArrayBuffer, Array, or Array-like Object\\.' ) ;
973
-
974
- assert . throws ( ( ) => Buffer . from ( ) , regErrorMsg ) ;
975
- assert . throws ( ( ) => Buffer . from ( null ) , regErrorMsg ) ;
970
+ assert . throws ( ( ) => Buffer . from ( ) , {
971
+ name : 'TypeError [ERR_INVALID_ARG_TYPE]' ,
972
+ message : 'The first argument must be one of type string, Buffer, ' +
973
+ 'ArrayBuffer, Array, or Array-like Object. Received type undefined'
974
+ } ) ;
975
+ assert . throws ( ( ) => Buffer . from ( null ) , {
976
+ name : 'TypeError [ERR_INVALID_ARG_TYPE]' ,
977
+ message : 'The first argument must be one of type string, Buffer, ' +
978
+ 'ArrayBuffer, Array, or Array-like Object. Received type object'
979
+ } ) ;
976
980
977
981
// Test prototype getters don't throw
978
982
assert . strictEqual ( Buffer . prototype . parent , undefined ) ;
0 commit comments