Skip to content

Commit b5b23bd

Browse files
Trottevanlucas
authored andcommitted
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: #16272 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent bd7822b commit b5b23bd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/parallel/test-http-outgoing-proto.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,14 @@ assert.throws(() => {
9696
message: 'The first argument must be one of type string or buffer'
9797
}));
9898

99-
// addTrailers
99+
// addTrailers()
100+
// The `Error` comes from the JavaScript engine so confirm that it is a
101+
// `TypeError` but do not check the message. It will be different in different
102+
// JavaScript engines.
100103
assert.throws(() => {
101104
const outgoingMessage = new OutgoingMessage();
102105
outgoingMessage.addTrailers();
103-
}, /^TypeError: Cannot convert undefined or null to object$/);
106+
}, TypeError);
104107

105108
assert.throws(() => {
106109
const outgoingMessage = new OutgoingMessage();

0 commit comments

Comments
 (0)