Skip to content

Commit

Permalink
fix http client test for Node 16
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Jun 8, 2021
1 parent 929c755 commit 73d858e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/collector/test/tracing/protocols/http/client/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ function registerTests(useHttps) {
span => expect(span.ec).to.equal(1),
span =>
expect(span.data.http.url).to.match(/ha-te-te-peh:\/\/999\.0\.0\.1(?:\/)?:not-a-port\/malformed-url/),
span => expect(span.data.http.error).to.match(/Protocol .* not supported./),
span => {
if (semver.gte(process.version, '16.2.0')) {
expect(span.data.http.error).to.equal('Invalid URL');
} else if (semver.gte(process.version, '16.0.0')) {
expect(span.data.http.error).to.match(/Invalid URL: /);
} else {
expect(span.data.http.error).to.match(/Protocol .* not supported./);
}
},
span => expect(span.t).to.equal(entrySpan.t),
span => expect(span.p).to.equal(entrySpan.s)
]);
Expand Down

0 comments on commit 73d858e

Please sign in to comment.