@webex/internal-plugin-metrics 3.0.0-beta.413 → 3.0.0-beta.415

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/metrics.js CHANGED
@@ -165,7 +165,7 @@ var Metrics = _webexCore.WebexPlugin.extend({
165
165
  });
166
166
  });
167
167
  },
168
- version: "3.0.0-beta.413"
168
+ version: "3.0.0-beta.415"
169
169
  });
170
170
  var _default = Metrics;
171
171
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/internal-plugin-metrics",
3
- "version": "3.0.0-beta.413",
3
+ "version": "3.0.0-beta.415",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -28,14 +28,14 @@
28
28
  "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
29
29
  },
30
30
  "dependencies": {
31
- "@webex/common": "3.0.0-beta.413",
32
- "@webex/common-timers": "3.0.0-beta.413",
31
+ "@webex/common": "3.0.0-beta.415",
32
+ "@webex/common-timers": "3.0.0-beta.415",
33
33
  "@webex/event-dictionary-ts": "^1.0.1406",
34
- "@webex/internal-plugin-device": "3.0.0-beta.413",
35
- "@webex/internal-plugin-metrics": "3.0.0-beta.413",
36
- "@webex/test-helper-chai": "3.0.0-beta.413",
37
- "@webex/test-helper-mock-webex": "3.0.0-beta.413",
38
- "@webex/webex-core": "3.0.0-beta.413",
34
+ "@webex/internal-plugin-device": "3.0.0-beta.415",
35
+ "@webex/internal-plugin-metrics": "3.0.0-beta.415",
36
+ "@webex/test-helper-chai": "3.0.0-beta.415",
37
+ "@webex/test-helper-mock-webex": "3.0.0-beta.415",
38
+ "@webex/webex-core": "3.0.0-beta.415",
39
39
  "ip-anonymize": "^0.1.0",
40
40
  "lodash": "^4.17.21",
41
41
  "uuid": "^3.3.2"
@@ -56,7 +56,7 @@ describe('plugin-metrics', () => {
56
56
  });
57
57
 
58
58
  describe('#request()', () => {
59
- describe('when the request completes successfully', async () => {
59
+ describe('when the request completes successfully', () => {
60
60
  it('clears the queue', async () => {
61
61
  const promise = webex.internal.newMetrics.callDiagnosticMetrics.submitToCallDiagnostics(
62
62
  //@ts-ignore
@@ -135,9 +135,7 @@ describe('plugin-metrics', () => {
135
135
  webex.internal.newMetrics.callDiagnosticLatencies.getDiffBetweenTimestamps = sinon
136
136
  .stub()
137
137
  .returns(10);
138
- webex.internal.newMetrics.callDiagnosticLatencies.getU2CTime = sinon
139
- .stub()
140
- .returns(20);
138
+ webex.internal.newMetrics.callDiagnosticLatencies.getU2CTime = sinon.stub().returns(20);
141
139
  const promise = webex.internal.newMetrics.callDiagnosticMetrics.submitToCallDiagnostics(
142
140
  //@ts-ignore
143
141
  {event: {name: 'client.call.initiated'}}
@@ -154,7 +152,7 @@ describe('plugin-metrics', () => {
154
152
  meetingInfoReqResp: 10,
155
153
  registerWDMDeviceJMT: 10,
156
154
  showInterstitialTime: 10,
157
- getU2CTime: 20
155
+ getU2CTime: 20,
158
156
  },
159
157
  });
160
158
  assert.lengthOf(
@@ -175,7 +173,7 @@ describe('plugin-metrics', () => {
175
173
  webex.internal.newMetrics.callDiagnosticLatencies.getCallInitJoinReq = sinon
176
174
  .stub()
177
175
  .returns(10);
178
- webex.internal.newMetrics.callDiagnosticLatencies.getDownloadTimeJMT = sinon
176
+ webex.internal.newMetrics.callDiagnosticLatencies.getDownloadTimeJMT = sinon
179
177
  .stub()
180
178
  .returns(100);
181
179
  const promise = webex.internal.newMetrics.callDiagnosticMetrics.submitToCallDiagnostics(
@@ -14,6 +14,7 @@ import {omit} from 'lodash';
14
14
 
15
15
  //@ts-ignore
16
16
  global.window = {location: {hostname: 'whatever'}};
17
+ process.env.NODE_ENV = 'test';
17
18
 
18
19
  const {getOSName, getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();
19
20
  const userAgent = `webex-js-sdk/test-webex-version client=Cantina; (os=${getOSName()}/${
@@ -1920,7 +1921,6 @@ describe('internal-plugin-metrics', () => {
1920
1921
  body: {},
1921
1922
  options: {headers: {}, url: 'https://example.com'},
1922
1923
  });
1923
-
1924
1924
  error.payloadOverrides = {
1925
1925
  shownToUser: true,
1926
1926
  category: 'expected',
@@ -40,7 +40,6 @@ describe('internal-plugin-metrics', () => {
40
40
  },
41
41
  };
42
42
  clearEmptyKeysRecursively(obj);
43
- console.log(obj);
44
43
  assert.deepEqual(obj, {nested: {arr: ['test']}});
45
44
  });
46
45
 
@@ -261,7 +260,7 @@ describe('internal-plugin-metrics', () => {
261
260
  });
262
261
  });
263
262
 
264
- describe('prepareDiagnosticMetricItem', async () => {
263
+ describe('prepareDiagnosticMetricItem', () => {
265
264
  let webex: any;
266
265
 
267
266
  const check = (eventName: string, expectedEvent: any) => {
@@ -283,7 +282,7 @@ describe('internal-plugin-metrics', () => {
283
282
  });
284
283
  };
285
284
 
286
- before(async () => {
285
+ beforeEach(async () => {
287
286
  webex = {internal: {newMetrics: {}}};
288
287
  webex.internal.newMetrics.callDiagnosticLatencies = new CallDiagnosticLatencies(
289
288
  {},
@@ -416,7 +415,7 @@ describe('internal-plugin-metrics', () => {
416
415
  });
417
416
  });
418
417
 
419
- describe('setMetricTimings', async () => {
418
+ describe('setMetricTimings', () => {
420
419
  let webex: any;
421
420
 
422
421
  const check = (options: any, expectedOptions: any) => {
@@ -12,6 +12,8 @@ import {BrowserDetection} from '@webex/common';
12
12
 
13
13
  const {getOSVersion} = BrowserDetection();
14
14
 
15
+ //@ts-ignore
16
+ global.window = {location: {hostname: 'whatever'}};
15
17
  function promiseTick(count) {
16
18
  let promise = Promise.resolve();
17
19
 
@@ -93,7 +95,7 @@ describe('plugin-metrics', () => {
93
95
  webex.credentials = new Credentials(undefined, {parent: webex});
94
96
  sinon.stub(webex.credentials, 'getClientToken').returns(Promise.resolve('token'));
95
97
 
96
- webex.internal = {...webex.internal, device: {userId: 'userId'}};
98
+ webex.internal = {...webex.internal};
97
99
  webex.config = {
98
100
  ...webex.config,
99
101
  appName: 'appName',