2
2
3
3
const IbmAnalyticsEngineApiV2 = require ( '../../dist/ibm-analytics-engine-api/v2' ) ;
4
4
const { IamAuthenticator } = require ( '../../dist/auth' ) ;
5
- const authHelper = require ( '../resources/auth.js' ) ;
6
- // const describe = authHelper.describe; // this runs describe.skip if there is no auth.js file :)
7
- const timeout = 20000 ; // jest timeout in ms
5
+ const authHelper = require ( '../resources/auth-helper .js' ) ;
6
+ const describe = authHelper . describe ; // this runs describe.skip if there is no auth.js file :)
7
+ const timeout = 20000 ; // jest timeout in ms
8
8
9
9
describe ( 'IBM Analytics Engine ApiV2 integration' , ( ) => {
10
- const options = authHelper . ibm_analytics_engine_api_v2 ;
11
- options . authenticator = new IamAuthenticator ( { apikey : options . apikey } ) ;
12
- const instanceGuid = options . instance_guid ;
10
+ const options = authHelper . auth . ibm_analytics_engine_api_v2 ;
11
+ options . authenticator = new IamAuthenticator ( { apikey : options . apikey } ) ;
12
+ const instanceGuid = options . instanceGuid ;
13
13
14
14
const IbmAnalyticsEngineServiceClient = new IbmAnalyticsEngineApiV2 ( options ) ;
15
- jest . setTimeout ( timeout ) ;
15
+ jest . setTimeout ( timeout ) ;
16
16
17
17
// nested describe statements are helpful when organizing multiple categories of an api
18
18
describe ( 'analyticsEngines' , ( ) => {
19
- // let resourceId;
19
+ let resourceId ;
20
20
21
21
it ( 'getAnalyticsEngineById' , async done => {
22
22
const params = {
23
- instanceGuid : instanceGuid ,
23
+ instanceGuid : instanceGuid
24
24
} ;
25
25
26
26
let response ;
@@ -29,13 +29,14 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
29
29
} catch ( err ) {
30
30
done ( err ) ;
31
31
}
32
+
32
33
expect ( response . status ) . toEqual ( 200 ) ;
33
34
done ( ) ;
34
35
} ) ;
35
36
36
37
it ( 'getAnalyticsEngineStateById' , async done => {
37
38
const params = {
38
- instanceGuid : instanceGuid ,
39
+ instanceGuid : instanceGuid
39
40
} ;
40
41
41
42
let response ;
@@ -44,11 +45,13 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
44
45
} catch ( err ) {
45
46
done ( err ) ;
46
47
}
48
+
47
49
expect ( response . status ) . toEqual ( 200 ) ;
48
50
done ( ) ;
49
51
} ) ;
50
52
51
53
it ( 'createCustomizationRequest' , async done => {
54
+
52
55
// AnalyticsEngineCustomActionScript
53
56
const analyticsEngineCustomActionScriptModel = {
54
57
source_type : 'http' ,
@@ -85,7 +88,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
85
88
86
89
it ( 'getAllCustomizationRequests' , async done => {
87
90
const params = {
88
- instanceGuid : instanceGuid ,
91
+ instanceGuid : instanceGuid
89
92
} ;
90
93
91
94
let response ;
@@ -100,7 +103,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
100
103
} ) ;
101
104
102
105
it ( 'getCustomizationRequestById' , async done => {
103
- const params = {
106
+ var params = {
104
107
instanceGuid : instanceGuid ,
105
108
} ;
106
109
@@ -142,7 +145,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
142
145
143
146
it ( 'resetClusterPassword' , async done => {
144
147
const params = {
145
- instanceGuid : instanceGuid ,
148
+ instanceGuid : instanceGuid
146
149
} ;
147
150
148
151
let response ;
@@ -193,7 +196,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
193
196
194
197
it ( 'getLoggingConfig' , async done => {
195
198
const params = {
196
- instanceGuid : instanceGuid ,
199
+ instanceGuid : instanceGuid
197
200
} ;
198
201
199
202
let response ;
@@ -209,7 +212,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
209
212
210
213
it ( 'deleteLoggingConfig' , async done => {
211
214
const params = {
212
- instanceGuid : instanceGuid ,
215
+ instanceGuid : instanceGuid
213
216
} ;
214
217
215
218
let response ;
@@ -223,6 +226,7 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
223
226
done ( ) ;
224
227
} ) ;
225
228
229
+
226
230
it ( 'updatePrivateEndpointWhitelist' , async done => {
227
231
const ipRanges = [ 'testString' ] ;
228
232
const action = 'add' ;
@@ -244,3 +248,4 @@ describe('IBM Analytics Engine ApiV2 integration', () => {
244
248
} ) ;
245
249
} ) ;
246
250
} ) ;
251
+
0 commit comments