From b5b23bd3e81d97c66a7143fb3e28f5420c766767 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 15:59:41 -0700 Subject: [PATCH] test: make test-http-outgoing-proto agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not check the error message if it is generated by the JavaScript engine (V8, ChakraCore, etc.). Do confirm that it is a `TypeError`. PR-URL: https://github.com/nodejs/node/pull/16272 Reviewed-By: Michaël Zasso Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tobias Nießen --- test/parallel/test-http-outgoing-proto.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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();