zipkin-instrumentation-fetch
Advanced tools
Comparing version 0.13.0 to 0.14.0
{ | ||
"name": "zipkin-instrumentation-fetch", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Interceptor for HTTP clients using the 'fetch' API", | ||
@@ -19,4 +19,4 @@ "main": "lib/index.js", | ||
"node-fetch": "^1.5.3", | ||
"zipkin": "^0.13.0" | ||
"zipkin": "^0.14.0" | ||
} | ||
} |
@@ -41,4 +41,6 @@ const {Tracer, ExplicitContext, createNoopTracer} = require('zipkin'); | ||
const path = `http://127.0.0.1:${this.port}/user`; | ||
fetch(path, {method: 'post'}) | ||
const host = '127.0.0.1'; | ||
const urlPath = '/user'; | ||
const url = `http://${host}:${this.port}${urlPath}`; | ||
fetch(url, {method: 'post'}) | ||
.then(res => res.json()) | ||
@@ -61,4 +63,4 @@ .then(data => { | ||
expect(annotations[2].annotation.annotationType).to.equal('BinaryAnnotation'); | ||
expect(annotations[2].annotation.key).to.equal('http.url'); | ||
expect(annotations[2].annotation.value).to.equal(path); | ||
expect(annotations[2].annotation.key).to.equal('http.path'); | ||
expect(annotations[2].annotation.value).to.equal(urlPath); | ||
@@ -117,4 +119,5 @@ expect(annotations[3].annotation.annotationType).to.equal('ClientSend'); | ||
const path = 'http://domain.invalid'; | ||
fetch(path, {method: 'post'}) | ||
const host = 'domain.invalid'; | ||
const url = `http://${host}`; | ||
fetch(url, {method: 'post'}) | ||
.then(() => expect.fail()) | ||
@@ -137,4 +140,4 @@ .catch(() => { | ||
expect(annotations[2].annotation.annotationType).to.equal('BinaryAnnotation'); | ||
expect(annotations[2].annotation.key).to.equal('http.url'); | ||
expect(annotations[2].annotation.value).to.equal(path); | ||
expect(annotations[2].annotation.key).to.equal('http.path'); | ||
expect(annotations[2].annotation.value).to.equal('/'); | ||
@@ -141,0 +144,0 @@ expect(annotations[3].annotation.annotationType).to.equal('ClientSend'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9448
185