summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-10-17 15:59:41 -0700
committerJames M Snell <jasnell@gmail.com>2017-11-11 17:40:33 -0800
commit5f2453a1f412893102bb2a01c1bd49aea2281ece (patch)
treea1ff076be0b421383c4a05421b9ef0f33dd180f8 /test
parentf16507bd224a728928258abdcc35b1b43a554d54 (diff)
downloadandroid-node-v8-5f2453a1f412893102bb2a01c1bd49aea2281ece.tar.gz
android-node-v8-5f2453a1f412893102bb2a01c1bd49aea2281ece.tar.bz2
android-node-v8-5f2453a1f412893102bb2a01c1bd49aea2281ece.zip
test: make test-http-outgoing-proto agnostic
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 <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-outgoing-proto.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/parallel/test-http-outgoing-proto.js b/test/parallel/test-http-outgoing-proto.js
index 7db252dfbf..c0ef90cdd9 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();