diff --git a/test/parallel/test-http-outgoing-proto.js b/test/parallel/test-http-outgoing-proto.js index 22eba0981f6fc2..3c0c07a967fe2b 100644 --- a/test/parallel/test-http-outgoing-proto.js +++ b/test/parallel/test-http-outgoing-proto.js @@ -96,11 +96,14 @@ assert.throws(() => { message: 'The first argument must be one of type string or buffer' })); -// addTrailers +// addTrailers() +// The `Error` comes from the JavaScript engine so confirm that it is a +// `TypeError` but do not check the message. It will be different in different +// JavaScript engines. assert.throws(() => { const outgoingMessage = new OutgoingMessage(); outgoingMessage.addTrailers(); -}, /^TypeError: Cannot convert undefined or null to object$/); +}, TypeError); assert.throws(() => { const outgoingMessage = new OutgoingMessage();