Skip to content

Commit

Permalink
style(opentelemetry-plugin-xml-http-request): cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
thgao committed Jun 18, 2020
1 parent 8f11a63 commit b0fedd7
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import {
PerformanceTimingNames as PTN,
WebTracerProvider,
parseUrl
parseUrl,
} from '@opentelemetry/web';
import * as assert from 'assert';
import * as sinon from 'sinon';
Expand Down Expand Up @@ -468,9 +468,8 @@ describe('xhr', () => {
});

it('should NOT clear the resources', () => {
assert.strictEqual(
clearResourceTimingsSpy.args.length,
0,
assert.ok(
clearResourceTimingsSpy.notCalled,
'resources have been cleared'
);
});
Expand Down Expand Up @@ -580,11 +579,7 @@ describe('xhr', () => {
});

it('should NOT create any span', () => {
assert.strictEqual(
exportSpy.args.length,
0,
"span shouldn't be exported"
);
assert.ok(exportSpy.notCalled, "span shouldn't be exported");
});
});

Expand All @@ -599,16 +594,15 @@ describe('xhr', () => {
});

it('should clear the resources', () => {
assert.strictEqual(
clearResourceTimingsSpy.args.length,
1,
assert.ok(
clearResourceTimingsSpy.calledOnce,
"resources haven't been cleared"
);
});
});

describe('when reusing the same XML Http request', () => {
let reusableReq: XMLHttpRequest; //= new XMLHttpRequest();
let reusableReq: XMLHttpRequest;
const firstUrl = 'http://localhost:8090/get';
const secondUrl = 'http://localhost:8099/get';
const getDataReuseXHR = (
Expand Down

0 comments on commit b0fedd7

Please sign in to comment.