From b0fedd7c3f927b3329f57ac0f1e49c984dcc5f4c Mon Sep 17 00:00:00 2001 From: Tina Gao Date: Wed, 17 Jun 2020 14:07:21 -0400 Subject: [PATCH] style(opentelemetry-plugin-xml-http-request): cleaned up --- .../test/xhr.test.ts | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts b/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts index 5d484f1d29..f7416b2800 100644 --- a/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts +++ b/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts @@ -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'; @@ -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' ); }); @@ -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"); }); }); @@ -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 = (