@@ -26,6 +26,7 @@ describe("buildInfo", () => {
26
26
sandbox = sinon . createSandbox ( ) ;
27
27
setUsernameStub = sandbox . stub ( ) ;
28
28
setAccessKeyStub = sandbox . stub ( ) ;
29
+ getInitialDetailsStub = sandbox . stub ( ) ;
29
30
validateBstackJsonStub = sandbox . stub ( ) ;
30
31
getConfigPathStub = sandbox . stub ( ) ;
31
32
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
@@ -54,6 +55,7 @@ describe("buildInfo", () => {
54
55
'../helpers/utils' : {
55
56
setUsername : setUsernameStub ,
56
57
setAccessKey : setAccessKeyStub ,
58
+ getInitialDetails : getInitialDetailsStub ,
57
59
validateBstackJson : validateBstackJsonStub ,
58
60
getErrorCodeFromErr : getErrorCodeFromErrStub ,
59
61
sendUsageReport : sendUsageReportStub ,
@@ -68,13 +70,15 @@ describe("buildInfo", () => {
68
70
} ) ;
69
71
70
72
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
73
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
71
74
72
75
return info ( args , rawArgs )
73
76
. then ( function ( _bsConfig ) {
74
77
sinon . assert . calledOnce ( requestStub ) ;
75
78
sinon . assert . calledOnce ( getConfigPathStub ) ;
76
79
sinon . assert . calledOnce ( getUserAgentStub ) ;
77
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
80
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
81
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
78
82
} ) . catch ( ( error ) => {
79
83
chai . assert . isNotOk ( error , 'Promise error' ) ;
80
84
} ) ;
@@ -93,6 +97,7 @@ describe("buildInfo", () => {
93
97
'../helpers/utils' : {
94
98
setUsername : setUsernameStub ,
95
99
setAccessKey : setAccessKeyStub ,
100
+ getInitialDetails : getInitialDetailsStub ,
96
101
validateBstackJson : validateBstackJsonStub ,
97
102
getErrorCodeFromErr : getErrorCodeFromErrStub ,
98
103
sendUsageReport : sendUsageReportStub ,
@@ -106,14 +111,16 @@ describe("buildInfo", () => {
106
111
request : { get : requestStub } ,
107
112
} ) ;
108
113
114
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
109
115
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
110
116
111
117
return info ( args , rawArgs )
112
118
. then ( function ( _bsConfig ) {
113
119
sinon . assert . calledOnce ( requestStub ) ;
114
120
sinon . assert . calledOnce ( getUserAgentStub ) ;
115
121
sinon . assert . calledOnce ( getConfigPathStub ) ;
116
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
122
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
123
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
117
124
} )
118
125
. catch ( ( error ) => {
119
126
chai . assert . isNotOk ( error , "Promise error" ) ;
@@ -126,6 +133,7 @@ describe("buildInfo", () => {
126
133
sandbox = sinon . createSandbox ( ) ;
127
134
setUsernameStub = sandbox . stub ( ) ;
128
135
setAccessKeyStub = sandbox . stub ( ) ;
136
+ getInitialDetailsStub = sandbox . stub ( ) ;
129
137
validateBstackJsonStub = sandbox . stub ( ) ;
130
138
getConfigPathStub = sandbox . stub ( ) ;
131
139
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
@@ -156,6 +164,7 @@ describe("buildInfo", () => {
156
164
'../helpers/utils' : {
157
165
setUsername : setUsernameStub ,
158
166
setAccessKey : setAccessKeyStub ,
167
+ getInitialDetails : getInitialDetailsStub ,
159
168
validateBstackJson : validateBstackJsonStub ,
160
169
getErrorCodeFromErr : getErrorCodeFromErrStub ,
161
170
sendUsageReport : sendUsageReportStub ,
@@ -170,13 +179,15 @@ describe("buildInfo", () => {
170
179
} ) ;
171
180
172
181
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
182
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
173
183
174
184
return info ( args , rawArgs )
175
185
. then ( function ( _bsConfig ) {
176
186
sinon . assert . calledOnce ( requestStub ) ;
177
187
sinon . assert . calledOnce ( getUserAgentStub ) ;
178
188
sinon . assert . calledOnce ( getConfigPathStub ) ;
179
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
189
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
190
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
180
191
} )
181
192
. catch ( ( error ) => {
182
193
chai . assert . isNotOk ( error , "Promise error" ) ;
@@ -201,6 +212,7 @@ describe("buildInfo", () => {
201
212
'../helpers/utils' : {
202
213
setUsername : setUsernameStub ,
203
214
setAccessKey : setAccessKeyStub ,
215
+ getInitialDetails : getInitialDetailsStub ,
204
216
validateBstackJson : validateBstackJsonStub ,
205
217
getErrorCodeFromErr : getErrorCodeFromErrStub ,
206
218
sendUsageReport : sendUsageReportStub ,
@@ -215,13 +227,14 @@ describe("buildInfo", () => {
215
227
} ) ;
216
228
217
229
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
218
-
230
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
219
231
return info ( args , rawArgs )
220
232
. then ( function ( _bsConfig ) {
221
233
sinon . assert . calledOnce ( requestStub ) ;
222
234
sinon . assert . calledOnce ( getUserAgentStub ) ;
223
235
sinon . assert . calledOnce ( getConfigPathStub ) ;
224
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
236
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
237
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
225
238
} )
226
239
. catch ( ( error ) => {
227
240
chai . assert . isNotOk ( error , "Promise error" ) ;
@@ -241,6 +254,7 @@ describe("buildInfo", () => {
241
254
'../helpers/utils' : {
242
255
setUsername : setUsernameStub ,
243
256
setAccessKey : setAccessKeyStub ,
257
+ getInitialDetails : getInitialDetailsStub ,
244
258
validateBstackJson : validateBstackJsonStub ,
245
259
getErrorCodeFromErr : getErrorCodeFromErrStub ,
246
260
sendUsageReport : sendUsageReportStub ,
@@ -255,13 +269,15 @@ describe("buildInfo", () => {
255
269
} ) ;
256
270
257
271
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
272
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
258
273
259
274
return info ( args , rawArgs )
260
275
. then ( function ( _bsConfig ) {
261
276
sinon . assert . calledOnce ( requestStub ) ;
262
277
sinon . assert . calledOnce ( getUserAgentStub ) ;
263
278
sinon . assert . calledOnce ( getConfigPathStub ) ;
264
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
279
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
280
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
265
281
} )
266
282
. catch ( ( error ) => {
267
283
chai . assert . isNotOk ( error , "Promise error" ) ;
@@ -276,6 +292,7 @@ describe("buildInfo", () => {
276
292
sandbox = sinon . createSandbox ( ) ;
277
293
setUsernameStub = sandbox . stub ( ) ;
278
294
setAccessKeyStub = sandbox . stub ( ) ;
295
+ getInitialDetailsStub = sandbox . stub ( ) ;
279
296
validateBstackJsonStub = sandbox . stub ( ) ;
280
297
getConfigPathStub = sandbox . stub ( ) ;
281
298
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
@@ -304,6 +321,7 @@ describe("buildInfo", () => {
304
321
'../helpers/utils' : {
305
322
setUsername : setUsernameStub ,
306
323
setAccessKey : setAccessKeyStub ,
324
+ getInitialDetails : getInitialDetailsStub ,
307
325
validateBstackJson : validateBstackJsonStub ,
308
326
getErrorCodeFromErr : getErrorCodeFromErrStub ,
309
327
sendUsageReport : sendUsageReportStub ,
@@ -317,13 +335,15 @@ describe("buildInfo", () => {
317
335
} ) ;
318
336
319
337
validateBstackJsonStub . returns ( Promise . resolve ( bsConfig ) ) ;
338
+ getInitialDetailsStub . returns ( Promise . resolve ( { } ) ) ;
320
339
321
340
return info ( args , rawArgs )
322
341
. then ( function ( _bsConfig ) {
323
342
sinon . assert . calledOnce ( requestStub ) ;
324
343
sinon . assert . calledOnce ( getUserAgentStub ) ;
325
344
sinon . assert . calledOnce ( getConfigPathStub ) ;
326
- sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , null , rawArgs ) ;
345
+ sinon . assert . calledOnce ( getInitialDetailsStub ) ;
346
+ sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode , { } , rawArgs ) ;
327
347
} ) . catch ( ( error ) => {
328
348
chai . assert . isNotOk ( error , 'Promise error' ) ;
329
349
} ) ;
@@ -337,6 +357,7 @@ describe("buildInfo", () => {
337
357
sandbox = sinon . createSandbox ( ) ;
338
358
setUsernameStub = sandbox . stub ( ) ;
339
359
setAccessKeyStub = sandbox . stub ( ) ;
360
+ getInitialDetailsStub = sandbox . stub ( ) ;
340
361
getConfigPathStub = sandbox . stub ( ) ;
341
362
validateBstackJsonStub = sandbox . stub ( ) ;
342
363
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
@@ -358,6 +379,7 @@ describe("buildInfo", () => {
358
379
'../helpers/utils' : {
359
380
setUsername : setUsernameStub ,
360
381
setAccessKey : setAccessKeyStub ,
382
+ getInitialDetails : getInitialDetailsStub ,
361
383
validateBstackJson : validateBstackJsonStub ,
362
384
getErrorCodeFromErr : getErrorCodeFromErrStub ,
363
385
sendUsageReport : sendUsageReportStub ,
@@ -369,6 +391,7 @@ describe("buildInfo", () => {
369
391
} ) ;
370
392
371
393
validateBstackJsonStub . returns ( Promise . reject ( { message : "reject error" } ) ) ;
394
+ getInitialDetailsStub . returns ( Promise . reject ( { message : "reject error" } ) ) ;
372
395
373
396
return info ( args , rawArgs )
374
397
. then ( function ( _bsConfig ) {
0 commit comments