@webex/webex-core 2.42.0 → 2.43.0
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/config.js.map +1 -1
- package/dist/credentials-config.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptors/auth.js.map +1 -1
- package/dist/interceptors/default-options.js.map +1 -1
- package/dist/interceptors/embargo.js.map +1 -1
- package/dist/interceptors/network-timing.js.map +1 -1
- package/dist/interceptors/payload-transformer.js.map +1 -1
- package/dist/interceptors/rate-limit.js.map +1 -1
- package/dist/interceptors/redirect.js.map +1 -1
- package/dist/interceptors/request-event.js.map +1 -1
- package/dist/interceptors/request-logger.js.map +1 -1
- package/dist/interceptors/request-timing.js.map +1 -1
- package/dist/interceptors/response-logger.js.map +1 -1
- package/dist/interceptors/user-agent.js.map +1 -1
- package/dist/interceptors/webex-tracking-id.js.map +1 -1
- package/dist/interceptors/webex-user-agent.js.map +1 -1
- package/dist/lib/batcher.js +1 -1
- package/dist/lib/batcher.js.map +1 -1
- package/dist/lib/credentials/credentials.js +1 -1
- package/dist/lib/credentials/credentials.js.map +1 -1
- package/dist/lib/credentials/grant-errors.js.map +1 -1
- package/dist/lib/credentials/index.js.map +1 -1
- package/dist/lib/credentials/scope.js.map +1 -1
- package/dist/lib/credentials/token-collection.js.map +1 -1
- package/dist/lib/credentials/token.js +1 -1
- package/dist/lib/credentials/token.js.map +1 -1
- package/dist/lib/page.js.map +1 -1
- package/dist/lib/services/constants.js.map +1 -1
- package/dist/lib/services/index.js.map +1 -1
- package/dist/lib/services/interceptors/server-error.js.map +1 -1
- package/dist/lib/services/interceptors/service.js.map +1 -1
- package/dist/lib/services/metrics.js.map +1 -1
- package/dist/lib/services/service-catalog.js.map +1 -1
- package/dist/lib/services/service-fed-ramp.js.map +1 -1
- package/dist/lib/services/service-host.js.map +1 -1
- package/dist/lib/services/service-registry.js.map +1 -1
- package/dist/lib/services/service-state.js.map +1 -1
- package/dist/lib/services/service-url.js.map +1 -1
- package/dist/lib/services/services.js +1 -1
- package/dist/lib/services/services.js.map +1 -1
- package/dist/lib/stateless-webex-plugin.js.map +1 -1
- package/dist/lib/storage/decorators.js.map +1 -1
- package/dist/lib/storage/errors.js.map +1 -1
- package/dist/lib/storage/index.js.map +1 -1
- package/dist/lib/storage/make-webex-plugin-store.js.map +1 -1
- package/dist/lib/storage/make-webex-store.js.map +1 -1
- package/dist/lib/storage/memory-store-adapter.js.map +1 -1
- package/dist/lib/webex-core-plugin-mixin.js.map +1 -1
- package/dist/lib/webex-http-error.js.map +1 -1
- package/dist/lib/webex-internal-core-plugin-mixin.js.map +1 -1
- package/dist/lib/webex-plugin.js.map +1 -1
- package/dist/plugins/logger.js +1 -1
- package/dist/plugins/logger.js.map +1 -1
- package/dist/webex-core.js +2 -2
- package/dist/webex-core.js.map +1 -1
- package/dist/webex-internal-core.js.map +1 -1
- package/package.json +14 -14
- package/test/unit/spec/_setup.js +6 -0
- package/test/unit/spec/credentials/credentials.js +13 -12
- package/test/unit/spec/interceptors/auth.js +1 -1
- package/test/unit/spec/interceptors/embargo.js +8 -8
- package/test/unit/spec/lib/page.js +3 -3
- package/test/unit/spec/services/interceptors/server-error.js +5 -5
- package/test/unit/spec/services/interceptors/service.js +12 -11
- package/test/unit/spec/services/service-catalog.js +24 -12
- package/test/unit/spec/services/service-host.js +3 -3
- package/test/unit/spec/services/service-registry.js +34 -44
- package/test/unit/spec/services/service-state.js +1 -1
- package/test/unit/spec/services/service-url.js +2 -2
- package/test/unit/spec/services/services.js +4 -4
- package/test/unit/spec/webex-core.js +0 -2
- package/test/unit/spec/webex-internal-core.js +0 -10
|
@@ -12,7 +12,7 @@ describe('webex-core', () => {
|
|
|
12
12
|
describe('EmbargoInterceptor', () => {
|
|
13
13
|
let interceptor;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
beforeAll(() => {
|
|
16
16
|
interceptor = new EmbargoInterceptor();
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ describe('webex-core', () => {
|
|
|
23
23
|
let options;
|
|
24
24
|
let reason;
|
|
25
25
|
|
|
26
|
-
beforeEach(
|
|
26
|
+
beforeEach(() => {
|
|
27
27
|
options = {
|
|
28
28
|
uri: 'http://not-a-url.com/embargoed',
|
|
29
29
|
};
|
|
@@ -46,8 +46,8 @@ describe('webex-core', () => {
|
|
|
46
46
|
].join('');
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
describe(
|
|
50
|
-
beforeEach(
|
|
49
|
+
describe('when the reason does have a \'451\' status code', () => {
|
|
50
|
+
beforeEach(() => {
|
|
51
51
|
reason = new WebexHttpError.InternalServerError({
|
|
52
52
|
message: 'test message',
|
|
53
53
|
statusCode: 451,
|
|
@@ -78,7 +78,7 @@ describe('webex-core', () => {
|
|
|
78
78
|
describe('when the device plugin is mounted', () => {
|
|
79
79
|
let deviceClear;
|
|
80
80
|
|
|
81
|
-
beforeEach(
|
|
81
|
+
beforeEach(() => {
|
|
82
82
|
interceptor.webex.internal.device = {
|
|
83
83
|
clear: sinon.spy(),
|
|
84
84
|
};
|
|
@@ -93,8 +93,8 @@ describe('webex-core', () => {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
describe(
|
|
97
|
-
beforeEach(
|
|
96
|
+
describe('when the reason does not have a \'451\' status code', () => {
|
|
97
|
+
beforeEach(() => {
|
|
98
98
|
reason = new WebexHttpError.InternalServerError({
|
|
99
99
|
message: 'test message',
|
|
100
100
|
statusCode: 452,
|
|
@@ -125,7 +125,7 @@ describe('webex-core', () => {
|
|
|
125
125
|
describe('when the device plugin is mounted', () => {
|
|
126
126
|
let deviceClear;
|
|
127
127
|
|
|
128
|
-
beforeEach(
|
|
128
|
+
beforeEach(() => {
|
|
129
129
|
interceptor.webex.internal.device = {
|
|
130
130
|
clear: sinon.spy(),
|
|
131
131
|
};
|
|
@@ -11,7 +11,7 @@ describe('webex-core', () => {
|
|
|
11
11
|
describe('#constructor', () => {
|
|
12
12
|
let page;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
beforeAll(() => {
|
|
15
15
|
sinon.stub(Page, 'parseLinkHeaders');
|
|
16
16
|
const response = {
|
|
17
17
|
body: {
|
|
@@ -45,7 +45,7 @@ describe('webex-core', () => {
|
|
|
45
45
|
describe('#next', () => {
|
|
46
46
|
let page, webex;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
beforeAll(() => {
|
|
49
49
|
webex = {
|
|
50
50
|
request: sinon.stub().returns(
|
|
51
51
|
Promise.resolve({
|
|
@@ -84,7 +84,7 @@ describe('webex-core', () => {
|
|
|
84
84
|
describe('#previous', () => {
|
|
85
85
|
let page, webex;
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
beforeAll(() => {
|
|
88
88
|
webex = {
|
|
89
89
|
request: sinon.stub().returns(
|
|
90
90
|
Promise.resolve({
|
|
@@ -12,7 +12,7 @@ describe('webex-core', () => {
|
|
|
12
12
|
describe('ServerErrorInterceptor', () => {
|
|
13
13
|
let interceptor;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
beforeAll(() => {
|
|
16
16
|
interceptor = new ServerErrorInterceptor();
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -76,7 +76,7 @@ describe('webex-core', () => {
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
describe('when the web-ha feature is enabled', () => {
|
|
79
|
-
beforeEach(
|
|
79
|
+
beforeEach(() => {
|
|
80
80
|
get.returns({value: true});
|
|
81
81
|
});
|
|
82
82
|
|
|
@@ -132,7 +132,7 @@ describe('webex-core', () => {
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
describe('when the web-ha feature is not available or disabled', () => {
|
|
135
|
-
beforeEach(
|
|
135
|
+
beforeEach(() => {
|
|
136
136
|
get.returns({value: false});
|
|
137
137
|
});
|
|
138
138
|
|
|
@@ -163,7 +163,7 @@ describe('webex-core', () => {
|
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
describe('when the reason is not a webex server error', () => {
|
|
166
|
-
beforeEach(
|
|
166
|
+
beforeEach(() => {
|
|
167
167
|
options.uri = 'http://not-a-url.com/';
|
|
168
168
|
reason = {};
|
|
169
169
|
});
|
|
@@ -178,7 +178,7 @@ describe('webex-core', () => {
|
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
describe('when the uri does not exist', () => {
|
|
181
|
-
beforeEach(
|
|
181
|
+
beforeEach(() => {
|
|
182
182
|
delete options.uri;
|
|
183
183
|
reason = new WebexHttpError.InternalServerError({
|
|
184
184
|
statusCode: 500,
|
|
@@ -34,8 +34,11 @@ describe('webex-core', () => {
|
|
|
34
34
|
describe('#generateUri()', () => {
|
|
35
35
|
let uri;
|
|
36
36
|
|
|
37
|
-
beforeEach(
|
|
38
|
-
uri = interceptor.generateUri(
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
uri = interceptor.generateUri(
|
|
39
|
+
fixture.serviceUrl,
|
|
40
|
+
fixture.resource
|
|
41
|
+
);
|
|
39
42
|
});
|
|
40
43
|
it('should remove all trailing slashes', () => assert.equal(uri.split('//').length, 2));
|
|
41
44
|
|
|
@@ -47,7 +50,7 @@ describe('webex-core', () => {
|
|
|
47
50
|
|
|
48
51
|
describe('#normalizeOptions()', () => {
|
|
49
52
|
describe('when the api parameter is defined', () => {
|
|
50
|
-
beforeEach(
|
|
53
|
+
beforeEach(() => {
|
|
51
54
|
options.api = fixture.api;
|
|
52
55
|
});
|
|
53
56
|
|
|
@@ -58,7 +61,7 @@ describe('webex-core', () => {
|
|
|
58
61
|
});
|
|
59
62
|
|
|
60
63
|
describe('when the service parameter is defined', () => {
|
|
61
|
-
beforeEach(
|
|
64
|
+
beforeEach(() => {
|
|
62
65
|
options.service = fixture.service;
|
|
63
66
|
});
|
|
64
67
|
|
|
@@ -73,7 +76,7 @@ describe('webex-core', () => {
|
|
|
73
76
|
|
|
74
77
|
describe('#onRequest()', () => {
|
|
75
78
|
describe('when the uri parameter is defined', () => {
|
|
76
|
-
beforeEach(
|
|
79
|
+
beforeEach(() => {
|
|
77
80
|
options.uri = fixture.uri;
|
|
78
81
|
});
|
|
79
82
|
|
|
@@ -89,7 +92,7 @@ describe('webex-core', () => {
|
|
|
89
92
|
describe('when the uri parameter is not defined', () => {
|
|
90
93
|
let waitForService;
|
|
91
94
|
|
|
92
|
-
beforeEach(
|
|
95
|
+
beforeEach(() => {
|
|
93
96
|
interceptor.normalizeOptions = sinon.stub();
|
|
94
97
|
interceptor.validateOptions = sinon.stub();
|
|
95
98
|
interceptor.generateUri = sinon.stub();
|
|
@@ -121,8 +124,6 @@ describe('webex-core', () => {
|
|
|
121
124
|
.then(() => assert.calledWith(waitForService, {name: options.service})));
|
|
122
125
|
|
|
123
126
|
describe('when the service url was collected successfully', () => {
|
|
124
|
-
beforeEach('generate additional mocks', () => {});
|
|
125
|
-
|
|
126
127
|
it('should attempt to generate the full uri', () =>
|
|
127
128
|
interceptor
|
|
128
129
|
.onRequest(options)
|
|
@@ -153,7 +154,7 @@ describe('webex-core', () => {
|
|
|
153
154
|
|
|
154
155
|
describe('#validateOptions()', () => {
|
|
155
156
|
describe('when the resource parameter is not defined', () => {
|
|
156
|
-
beforeEach(
|
|
157
|
+
beforeEach(() => {
|
|
157
158
|
options.service = fixture.service;
|
|
158
159
|
});
|
|
159
160
|
|
|
@@ -163,7 +164,7 @@ describe('webex-core', () => {
|
|
|
163
164
|
});
|
|
164
165
|
|
|
165
166
|
describe('when the service parameter is not defined', () => {
|
|
166
|
-
beforeEach(
|
|
167
|
+
beforeEach(() => {
|
|
167
168
|
options.resource = fixture.resource;
|
|
168
169
|
});
|
|
169
170
|
|
|
@@ -173,7 +174,7 @@ describe('webex-core', () => {
|
|
|
173
174
|
});
|
|
174
175
|
|
|
175
176
|
describe('when the service and resource parameters are defined', () => {
|
|
176
|
-
beforeEach(
|
|
177
|
+
beforeEach(() => {
|
|
177
178
|
options.service = fixture.service;
|
|
178
179
|
options.resource = fixture.resource;
|
|
179
180
|
});
|
|
@@ -13,7 +13,7 @@ describe('webex-core', () => {
|
|
|
13
13
|
let services;
|
|
14
14
|
let catalog;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
beforeAll(() => {
|
|
17
17
|
webex = new MockWebex();
|
|
18
18
|
services = new Services(undefined, {parent: webex});
|
|
19
19
|
catalog = services._getCatalog();
|
|
@@ -71,7 +71,7 @@ describe('webex-core', () => {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
describe('#clean()', () => {
|
|
74
|
-
beforeEach(
|
|
74
|
+
beforeEach(() => {
|
|
75
75
|
catalog.serviceGroups.preauth = [1, 2, 3];
|
|
76
76
|
catalog.serviceGroups.signin = [1, 2, 3];
|
|
77
77
|
catalog.serviceGroups.postauth = [1, 2, 3];
|
|
@@ -100,13 +100,17 @@ describe('webex-core', () => {
|
|
|
100
100
|
describe('#findAllowedDomain()', () => {
|
|
101
101
|
const domains = [];
|
|
102
102
|
|
|
103
|
-
beforeEach(
|
|
104
|
-
domains.push(
|
|
103
|
+
beforeEach(() => {
|
|
104
|
+
domains.push(
|
|
105
|
+
'example-a',
|
|
106
|
+
'example-b',
|
|
107
|
+
'example-c'
|
|
108
|
+
);
|
|
105
109
|
|
|
106
110
|
catalog.setAllowedDomains(domains);
|
|
107
111
|
});
|
|
108
112
|
|
|
109
|
-
afterEach(
|
|
113
|
+
afterEach(() => {
|
|
110
114
|
domains.length = 0;
|
|
111
115
|
});
|
|
112
116
|
|
|
@@ -120,13 +124,17 @@ describe('webex-core', () => {
|
|
|
120
124
|
describe('#getAllowedDomains()', () => {
|
|
121
125
|
const domains = [];
|
|
122
126
|
|
|
123
|
-
beforeEach(
|
|
124
|
-
domains.push(
|
|
127
|
+
beforeEach(() => {
|
|
128
|
+
domains.push(
|
|
129
|
+
'example-a',
|
|
130
|
+
'example-b',
|
|
131
|
+
'example-c'
|
|
132
|
+
);
|
|
125
133
|
|
|
126
134
|
catalog.setAllowedDomains(domains);
|
|
127
135
|
});
|
|
128
136
|
|
|
129
|
-
afterEach(
|
|
137
|
+
afterEach(() => {
|
|
130
138
|
domains.length = 0;
|
|
131
139
|
});
|
|
132
140
|
|
|
@@ -140,7 +148,7 @@ describe('webex-core', () => {
|
|
|
140
148
|
describe('#list()', () => {
|
|
141
149
|
let serviceList;
|
|
142
150
|
|
|
143
|
-
beforeEach(
|
|
151
|
+
beforeEach(() => {
|
|
144
152
|
serviceList = catalog.list();
|
|
145
153
|
});
|
|
146
154
|
|
|
@@ -159,13 +167,17 @@ describe('webex-core', () => {
|
|
|
159
167
|
describe('#setAllowedDomains()', () => {
|
|
160
168
|
const domains = [];
|
|
161
169
|
|
|
162
|
-
beforeEach(
|
|
163
|
-
domains.push(
|
|
170
|
+
beforeEach(() => {
|
|
171
|
+
domains.push(
|
|
172
|
+
'example-a',
|
|
173
|
+
'example-b',
|
|
174
|
+
'example-c'
|
|
175
|
+
);
|
|
164
176
|
|
|
165
177
|
catalog.setAllowedDomains(domains);
|
|
166
178
|
});
|
|
167
179
|
|
|
168
|
-
afterEach(
|
|
180
|
+
afterEach(() => {
|
|
169
181
|
domains.length = 0;
|
|
170
182
|
});
|
|
171
183
|
|
|
@@ -8,7 +8,7 @@ describe('webex-core', () => {
|
|
|
8
8
|
let fixture;
|
|
9
9
|
let serviceHost;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
beforeAll(() => {
|
|
12
12
|
fixture = {
|
|
13
13
|
catalog: 'discovery',
|
|
14
14
|
defaultUri: 'https://example-default.com/',
|
|
@@ -32,7 +32,7 @@ describe('webex-core', () => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
describe('class members', () => {
|
|
35
|
-
beforeEach(
|
|
35
|
+
beforeEach(() => {
|
|
36
36
|
serviceHost = new ServiceHost(fixture);
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -180,7 +180,7 @@ describe('webex-core', () => {
|
|
|
180
180
|
describe('#polyGenerate()', () => {
|
|
181
181
|
let polyFixture;
|
|
182
182
|
|
|
183
|
-
beforeEach(
|
|
183
|
+
beforeEach(() => {
|
|
184
184
|
polyFixture = {
|
|
185
185
|
catalog: fixture.catalog,
|
|
186
186
|
name: fixture.id.split(':')[3],
|
|
@@ -10,7 +10,7 @@ describe('webex-core', () => {
|
|
|
10
10
|
let fixtureHosts;
|
|
11
11
|
let serviceRegistry;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
beforeAll(() => {
|
|
14
14
|
fixture = {
|
|
15
15
|
serviceLinks: {
|
|
16
16
|
'example-service-a-name': 'http://example-service-a.com/',
|
|
@@ -63,7 +63,7 @@ describe('webex-core', () => {
|
|
|
63
63
|
}, []);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
beforeEach(
|
|
66
|
+
beforeEach(() => {
|
|
67
67
|
serviceRegistry = new ServiceRegistry();
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -77,7 +77,7 @@ describe('webex-core', () => {
|
|
|
77
77
|
describe('#map', () => {
|
|
78
78
|
let priorityLocalHosts;
|
|
79
79
|
|
|
80
|
-
beforeEach(
|
|
80
|
+
beforeEach(() => {
|
|
81
81
|
serviceRegistry.load(
|
|
82
82
|
ServiceRegistry.mapRemoteCatalog({
|
|
83
83
|
catalog: SERVICE_CATALOGS[0],
|
|
@@ -108,13 +108,11 @@ describe('webex-core', () => {
|
|
|
108
108
|
let filter;
|
|
109
109
|
let host;
|
|
110
110
|
|
|
111
|
-
beforeEach(
|
|
112
|
-
serviceRegistry.load(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
})
|
|
117
|
-
);
|
|
111
|
+
beforeEach(() => {
|
|
112
|
+
serviceRegistry.load(ServiceRegistry.mapRemoteCatalog({
|
|
113
|
+
catalog: SERVICE_CATALOGS[0],
|
|
114
|
+
...fixture
|
|
115
|
+
}));
|
|
118
116
|
|
|
119
117
|
host = serviceRegistry.hosts[0];
|
|
120
118
|
|
|
@@ -158,13 +156,11 @@ describe('webex-core', () => {
|
|
|
158
156
|
let filter;
|
|
159
157
|
let filteredHost;
|
|
160
158
|
|
|
161
|
-
beforeEach(
|
|
162
|
-
serviceRegistry.load(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
})
|
|
167
|
-
);
|
|
159
|
+
beforeEach(() => {
|
|
160
|
+
serviceRegistry.load(ServiceRegistry.mapRemoteCatalog({
|
|
161
|
+
catalog: SERVICE_CATALOGS[0],
|
|
162
|
+
...fixture
|
|
163
|
+
}));
|
|
168
164
|
|
|
169
165
|
filteredHost = serviceRegistry.hosts[0];
|
|
170
166
|
|
|
@@ -201,7 +197,7 @@ describe('webex-core', () => {
|
|
|
201
197
|
let failedHost;
|
|
202
198
|
let filteredHosts;
|
|
203
199
|
|
|
204
|
-
beforeEach(
|
|
200
|
+
beforeEach(() => {
|
|
205
201
|
hostList = ServiceRegistry.mapRemoteCatalog({
|
|
206
202
|
catalog: SERVICE_CATALOGS[0],
|
|
207
203
|
...fixture,
|
|
@@ -238,7 +234,7 @@ describe('webex-core', () => {
|
|
|
238
234
|
let hostsCustomA;
|
|
239
235
|
let hostsCustomB;
|
|
240
236
|
|
|
241
|
-
beforeEach(
|
|
237
|
+
beforeEach(() => {
|
|
242
238
|
hostsCustomA = ServiceRegistry.mapRemoteCatalog({
|
|
243
239
|
catalog: SERVICE_CATALOGS[0],
|
|
244
240
|
...fixture,
|
|
@@ -291,7 +287,7 @@ describe('webex-core', () => {
|
|
|
291
287
|
let remoteHosts;
|
|
292
288
|
let localHosts;
|
|
293
289
|
|
|
294
|
-
beforeEach(
|
|
290
|
+
beforeEach(() => {
|
|
295
291
|
serviceRegistry.load(
|
|
296
292
|
ServiceRegistry.mapRemoteCatalog({
|
|
297
293
|
catalog: SERVICE_CATALOGS[0],
|
|
@@ -331,7 +327,7 @@ describe('webex-core', () => {
|
|
|
331
327
|
let filteredHosts;
|
|
332
328
|
let priorityHosts;
|
|
333
329
|
|
|
334
|
-
beforeEach(
|
|
330
|
+
beforeEach(() => {
|
|
335
331
|
serviceRegistry.load(
|
|
336
332
|
ServiceRegistry.mapRemoteCatalog({
|
|
337
333
|
catalog: SERVICE_CATALOGS[0],
|
|
@@ -383,7 +379,7 @@ describe('webex-core', () => {
|
|
|
383
379
|
let serviceHosts;
|
|
384
380
|
let serviceName;
|
|
385
381
|
|
|
386
|
-
beforeEach(
|
|
382
|
+
beforeEach(() => {
|
|
387
383
|
serviceRegistry.load(
|
|
388
384
|
ServiceRegistry.mapRemoteCatalog({
|
|
389
385
|
catalog: SERVICE_CATALOGS[0],
|
|
@@ -437,7 +433,7 @@ describe('webex-core', () => {
|
|
|
437
433
|
let filteredHostA;
|
|
438
434
|
let filteredHostB;
|
|
439
435
|
|
|
440
|
-
beforeEach(
|
|
436
|
+
beforeEach(() => {
|
|
441
437
|
serviceRegistry.load(
|
|
442
438
|
ServiceRegistry.mapRemoteCatalog({
|
|
443
439
|
catalog: SERVICE_CATALOGS[0],
|
|
@@ -480,13 +476,11 @@ describe('webex-core', () => {
|
|
|
480
476
|
let filter;
|
|
481
477
|
let host;
|
|
482
478
|
|
|
483
|
-
beforeEach(
|
|
484
|
-
serviceRegistry.load(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
})
|
|
489
|
-
);
|
|
479
|
+
beforeEach(() => {
|
|
480
|
+
serviceRegistry.load(ServiceRegistry.mapRemoteCatalog({
|
|
481
|
+
catalog: SERVICE_CATALOGS[0],
|
|
482
|
+
...fixture
|
|
483
|
+
}));
|
|
490
484
|
|
|
491
485
|
host = serviceRegistry.hosts[0];
|
|
492
486
|
|
|
@@ -589,13 +583,11 @@ describe('webex-core', () => {
|
|
|
589
583
|
let filter;
|
|
590
584
|
let filteredHost;
|
|
591
585
|
|
|
592
|
-
beforeEach(
|
|
593
|
-
serviceRegistry.load(
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
})
|
|
598
|
-
);
|
|
586
|
+
beforeEach(() => {
|
|
587
|
+
serviceRegistry.load(ServiceRegistry.mapRemoteCatalog({
|
|
588
|
+
catalog: SERVICE_CATALOGS[0],
|
|
589
|
+
...fixture
|
|
590
|
+
}));
|
|
599
591
|
|
|
600
592
|
filteredHost = serviceRegistry.hosts[0];
|
|
601
593
|
|
|
@@ -631,13 +623,11 @@ describe('webex-core', () => {
|
|
|
631
623
|
let filter;
|
|
632
624
|
let filteredHost;
|
|
633
625
|
|
|
634
|
-
beforeEach(
|
|
635
|
-
serviceRegistry.load(
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
})
|
|
640
|
-
);
|
|
626
|
+
beforeEach(() => {
|
|
627
|
+
serviceRegistry.load(ServiceRegistry.mapRemoteCatalog({
|
|
628
|
+
catalog: SERVICE_CATALOGS[0],
|
|
629
|
+
...fixture
|
|
630
|
+
}));
|
|
641
631
|
|
|
642
632
|
filteredHost = serviceRegistry.hosts[0];
|
|
643
633
|
|
|
@@ -13,7 +13,7 @@ describe('webex-core', () => {
|
|
|
13
13
|
let serviceUrl;
|
|
14
14
|
let template;
|
|
15
15
|
|
|
16
|
-
beforeEach(
|
|
16
|
+
beforeEach(() => {
|
|
17
17
|
webex = new MockWebex();
|
|
18
18
|
/* eslint-disable-next-line no-unused-vars */
|
|
19
19
|
const services = new Services(undefined, {parent: webex});
|
|
@@ -128,7 +128,7 @@ describe('webex-core', () => {
|
|
|
128
128
|
describe('#_getPriorityHostUrl()', () => {
|
|
129
129
|
let highPriorityHost;
|
|
130
130
|
|
|
131
|
-
beforeEach(
|
|
131
|
+
beforeEach(() => {
|
|
132
132
|
highPriorityHost = serviceUrl._generateHostUrl(
|
|
133
133
|
serviceUrl.hosts.reduce((o, c) => (o.priority > c.priority || !o.homeCluster ? c : o))
|
|
134
134
|
.host
|
|
@@ -14,7 +14,7 @@ describe('webex-core', () => {
|
|
|
14
14
|
let services;
|
|
15
15
|
let catalog;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
beforeAll(() => {
|
|
18
18
|
webex = new MockWebex({
|
|
19
19
|
children: {
|
|
20
20
|
services: Services,
|
|
@@ -73,7 +73,7 @@ describe('webex-core', () => {
|
|
|
73
73
|
describe('#list()', () => {
|
|
74
74
|
let serviceList;
|
|
75
75
|
|
|
76
|
-
beforeEach(
|
|
76
|
+
beforeEach(() => {
|
|
77
77
|
serviceList = services.list();
|
|
78
78
|
});
|
|
79
79
|
|
|
@@ -93,7 +93,7 @@ describe('webex-core', () => {
|
|
|
93
93
|
it('successfully resolves with undefined if fetch request failed', () => {
|
|
94
94
|
webex.request = sinon.stub().returns(Promise.reject());
|
|
95
95
|
|
|
96
|
-
return
|
|
96
|
+
return services.fetchClientRegionInfo().then((r) => {
|
|
97
97
|
assert.isUndefined(r);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -307,7 +307,7 @@ describe('webex-core', () => {
|
|
|
307
307
|
identity: 'https://identity.webex.com',
|
|
308
308
|
};
|
|
309
309
|
|
|
310
|
-
beforeEach(
|
|
310
|
+
beforeEach(async () => {
|
|
311
311
|
const servicesList = {
|
|
312
312
|
idbroker: 'https://idbroker.webex.com',
|
|
313
313
|
identity: 'https://identity.webex.com/',
|
|
@@ -63,16 +63,6 @@ describe('Webex', () => {
|
|
|
63
63
|
webex.ready
|
|
64
64
|
)
|
|
65
65
|
);
|
|
66
|
-
webex.on('all', (ev) =>
|
|
67
|
-
console.info(
|
|
68
|
-
'XXX',
|
|
69
|
-
ev,
|
|
70
|
-
webex.credentials.ready,
|
|
71
|
-
webex.internal.test.ready,
|
|
72
|
-
webex.internal.ready,
|
|
73
|
-
webex.ready
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
66
|
|
|
77
67
|
const changeSpy = sinon.spy();
|
|
78
68
|
|