@@ -25,6 +25,7 @@ describe("buildInfo", () => {
25
25
setUsernameStub = sandbox . stub ( ) ;
26
26
setAccessKeyStub = sandbox . stub ( ) ;
27
27
validateBstackJsonStub = sandbox . stub ( ) ;
28
+ getConfigPathStub = sandbox . stub ( ) ;
28
29
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
29
30
getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
30
31
sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -54,6 +55,7 @@ describe("buildInfo", () => {
54
55
sendUsageReport : sendUsageReportStub ,
55
56
setUsageReportingFlag : setUsageReportingFlagStub ,
56
57
getUserAgent : getUserAgentStub ,
58
+ getConfigPath : getConfigPathStub
57
59
} ,
58
60
request : { get : requestStub } ,
59
61
} ) ;
@@ -63,6 +65,7 @@ describe("buildInfo", () => {
63
65
return info ( args )
64
66
. then ( function ( _bsConfig ) {
65
67
sinon . assert . calledOnce ( requestStub ) ;
68
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
66
69
sinon . assert . calledOnce ( getUserAgentStub ) ;
67
70
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
68
71
} ) . catch ( ( error ) => {
@@ -88,6 +91,7 @@ describe("buildInfo", () => {
88
91
sendUsageReport : sendUsageReportStub ,
89
92
setUsageReportingFlag : setUsageReportingFlagStub ,
90
93
getUserAgent : getUserAgentStub ,
94
+ getConfigPath : getConfigPathStub
91
95
} ,
92
96
request : { get : requestStub } ,
93
97
} ) ;
@@ -98,6 +102,7 @@ describe("buildInfo", () => {
98
102
. then ( function ( _bsConfig ) {
99
103
sinon . assert . calledOnce ( requestStub ) ;
100
104
sinon . assert . calledOnce ( getUserAgentStub ) ;
105
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
101
106
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
102
107
} )
103
108
. catch ( ( error ) => {
@@ -112,6 +117,7 @@ describe("buildInfo", () => {
112
117
setUsernameStub = sandbox . stub ( ) ;
113
118
setAccessKeyStub = sandbox . stub ( ) ;
114
119
validateBstackJsonStub = sandbox . stub ( ) ;
120
+ getConfigPathStub = sandbox . stub ( ) ;
115
121
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
116
122
getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
117
123
sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -143,6 +149,7 @@ describe("buildInfo", () => {
143
149
sendUsageReport : sendUsageReportStub ,
144
150
setUsageReportingFlag : setUsageReportingFlagStub ,
145
151
getUserAgent : getUserAgentStub ,
152
+ getConfigPath : getConfigPathStub
146
153
} ,
147
154
request : { get : requestStub } ,
148
155
} ) ;
@@ -153,6 +160,7 @@ describe("buildInfo", () => {
153
160
. then ( function ( _bsConfig ) {
154
161
sinon . assert . calledOnce ( requestStub ) ;
155
162
sinon . assert . calledOnce ( getUserAgentStub ) ;
163
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
156
164
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
157
165
} )
158
166
. catch ( ( error ) => {
@@ -183,6 +191,7 @@ describe("buildInfo", () => {
183
191
sendUsageReport : sendUsageReportStub ,
184
192
setUsageReportingFlag : setUsageReportingFlagStub ,
185
193
getUserAgent : getUserAgentStub ,
194
+ getConfigPath : getConfigPathStub
186
195
} ,
187
196
request : { get : requestStub } ,
188
197
} ) ;
@@ -193,6 +202,7 @@ describe("buildInfo", () => {
193
202
. then ( function ( _bsConfig ) {
194
203
sinon . assert . calledOnce ( requestStub ) ;
195
204
sinon . assert . calledOnce ( getUserAgentStub ) ;
205
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
196
206
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
197
207
} )
198
208
. catch ( ( error ) => {
@@ -218,6 +228,7 @@ describe("buildInfo", () => {
218
228
sendUsageReport : sendUsageReportStub ,
219
229
setUsageReportingFlag : setUsageReportingFlagStub ,
220
230
getUserAgent : getUserAgentStub ,
231
+ getConfigPath : getConfigPathStub
221
232
} ,
222
233
request : { get : requestStub } ,
223
234
} ) ;
@@ -228,6 +239,7 @@ describe("buildInfo", () => {
228
239
. then ( function ( _bsConfig ) {
229
240
sinon . assert . calledOnce ( requestStub ) ;
230
241
sinon . assert . calledOnce ( getUserAgentStub ) ;
242
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
231
243
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
232
244
} )
233
245
. catch ( ( error ) => {
@@ -244,6 +256,7 @@ describe("buildInfo", () => {
244
256
setUsernameStub = sandbox . stub ( ) ;
245
257
setAccessKeyStub = sandbox . stub ( ) ;
246
258
validateBstackJsonStub = sandbox . stub ( ) ;
259
+ getConfigPathStub = sandbox . stub ( ) ;
247
260
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
248
261
getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
249
262
sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -273,6 +286,7 @@ describe("buildInfo", () => {
273
286
sendUsageReport : sendUsageReportStub ,
274
287
setUsageReportingFlag : setUsageReportingFlagStub ,
275
288
getUserAgent : getUserAgentStub ,
289
+ getConfigPath : getConfigPathStub
276
290
} ,
277
291
request : { get : requestStub } ,
278
292
} ) ;
@@ -283,6 +297,7 @@ describe("buildInfo", () => {
283
297
. then ( function ( _bsConfig ) {
284
298
sinon . assert . calledOnce ( requestStub ) ;
285
299
sinon . assert . calledOnce ( getUserAgentStub ) ;
300
+ sinon . assert . calledOnce ( getConfigPathStub ) ;
286
301
sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
287
302
} ) . catch ( ( error ) => {
288
303
chai . assert . isNotOk ( error , 'Promise error' ) ;
@@ -297,6 +312,7 @@ describe("buildInfo", () => {
297
312
sandbox = sinon . createSandbox ( ) ;
298
313
setUsernameStub = sandbox . stub ( ) ;
299
314
setAccessKeyStub = sandbox . stub ( ) ;
315
+ getConfigPathStub = sandbox . stub ( ) ;
300
316
validateBstackJsonStub = sandbox . stub ( ) ;
301
317
setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
302
318
sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -319,6 +335,7 @@ describe("buildInfo", () => {
319
335
getErrorCodeFromErr : getErrorCodeFromErrStub ,
320
336
sendUsageReport : sendUsageReportStub ,
321
337
setUsageReportingFlag : setUsageReportingFlagStub ,
338
+ getConfigPath : getConfigPathStub
322
339
} ,
323
340
} ) ;
324
341
0 commit comments