diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index d3a879fc225353..2e7d164d6889db 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -131,3 +131,19 @@ const objects = [ assert.deepStrictEqual(v8.deserialize(buf), expectedResult); } + +{ + try { + v8.Serializer(); + } catch (e) { + const m = "Class constructor Serializer cannot be invoked without 'new'"; + assert.strictEqual(e.message, m); + } + + try { + v8.Deserializer(); + } catch (e) { + const m = "Class constructor Deserializer cannot be invoked without 'new'"; + assert.strictEqual(e.message, m); + } +}