diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 5625d4986081ae..806cbc5fc3414d 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -134,18 +134,12 @@ const objects = [ { assert.throws( - () => { - v8.Serializer(); - }, - Error, - "Class constructor Serializer cannot be invoked without 'new'" + () => { v8.Serializer(); }, + /^TypeError: Class constructor Serializer cannot be invoked without 'new'$/ ); assert.throws( - () => { - v8.Derializer(); - }, - Error, - "Class constructor Deserializer cannot be invoked without 'new'" + () => { v8.Deserializer(); }, + /^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/ ); }