forked from ringcentral/ringcentral-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDK-spec.js
34 lines (21 loc) · 795 Bytes
/
SDK-spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {expect, getSdk, getMock, getRegistry} from './test/test';
import SDK from './SDK';
describe('RingCentral', function() {
async function test(suite, server, done) {
suite.timeout(10000); // Per SLA should be 3 seconds
var sdk = new SDK({server: server, appKey: '', appSecret: ''});
try {
var response = await sdk.platform().get('', null, {skipAuthCheck: true});
expect(response.json().uri).to.equal(server + '/restapi/v1.0');
sdk.cache().clean();
} catch (e) {
throw e;
}
}
it('connects to sandbox', function() {
return test(this, SDK.server.sandbox);
});
it('connects to production', function() {
return test(this, SDK.server.production);
});
});