@@ -25,6 +25,7 @@ describe("buildInfo", () => {
2525 setUsernameStub = sandbox . stub ( ) ;
2626 setAccessKeyStub = sandbox . stub ( ) ;
2727 validateBstackJsonStub = sandbox . stub ( ) ;
28+ getConfigPathStub = sandbox . stub ( ) ;
2829 setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
2930 getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
3031 sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -54,6 +55,7 @@ describe("buildInfo", () => {
5455 sendUsageReport : sendUsageReportStub ,
5556 setUsageReportingFlag : setUsageReportingFlagStub ,
5657 getUserAgent : getUserAgentStub ,
58+ getConfigPath : getConfigPathStub
5759 } ,
5860 request : { get : requestStub } ,
5961 } ) ;
@@ -63,6 +65,7 @@ describe("buildInfo", () => {
6365 return info ( args )
6466 . then ( function ( _bsConfig ) {
6567 sinon . assert . calledOnce ( requestStub ) ;
68+ sinon . assert . calledOnce ( getConfigPathStub ) ;
6669 sinon . assert . calledOnce ( getUserAgentStub ) ;
6770 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
6871 } ) . catch ( ( error ) => {
@@ -88,6 +91,7 @@ describe("buildInfo", () => {
8891 sendUsageReport : sendUsageReportStub ,
8992 setUsageReportingFlag : setUsageReportingFlagStub ,
9093 getUserAgent : getUserAgentStub ,
94+ getConfigPath : getConfigPathStub
9195 } ,
9296 request : { get : requestStub } ,
9397 } ) ;
@@ -98,6 +102,7 @@ describe("buildInfo", () => {
98102 . then ( function ( _bsConfig ) {
99103 sinon . assert . calledOnce ( requestStub ) ;
100104 sinon . assert . calledOnce ( getUserAgentStub ) ;
105+ sinon . assert . calledOnce ( getConfigPathStub ) ;
101106 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
102107 } )
103108 . catch ( ( error ) => {
@@ -112,6 +117,7 @@ describe("buildInfo", () => {
112117 setUsernameStub = sandbox . stub ( ) ;
113118 setAccessKeyStub = sandbox . stub ( ) ;
114119 validateBstackJsonStub = sandbox . stub ( ) ;
120+ getConfigPathStub = sandbox . stub ( ) ;
115121 setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
116122 getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
117123 sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -143,6 +149,7 @@ describe("buildInfo", () => {
143149 sendUsageReport : sendUsageReportStub ,
144150 setUsageReportingFlag : setUsageReportingFlagStub ,
145151 getUserAgent : getUserAgentStub ,
152+ getConfigPath : getConfigPathStub
146153 } ,
147154 request : { get : requestStub } ,
148155 } ) ;
@@ -153,6 +160,7 @@ describe("buildInfo", () => {
153160 . then ( function ( _bsConfig ) {
154161 sinon . assert . calledOnce ( requestStub ) ;
155162 sinon . assert . calledOnce ( getUserAgentStub ) ;
163+ sinon . assert . calledOnce ( getConfigPathStub ) ;
156164 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
157165 } )
158166 . catch ( ( error ) => {
@@ -183,6 +191,7 @@ describe("buildInfo", () => {
183191 sendUsageReport : sendUsageReportStub ,
184192 setUsageReportingFlag : setUsageReportingFlagStub ,
185193 getUserAgent : getUserAgentStub ,
194+ getConfigPath : getConfigPathStub
186195 } ,
187196 request : { get : requestStub } ,
188197 } ) ;
@@ -193,6 +202,7 @@ describe("buildInfo", () => {
193202 . then ( function ( _bsConfig ) {
194203 sinon . assert . calledOnce ( requestStub ) ;
195204 sinon . assert . calledOnce ( getUserAgentStub ) ;
205+ sinon . assert . calledOnce ( getConfigPathStub ) ;
196206 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
197207 } )
198208 . catch ( ( error ) => {
@@ -218,6 +228,7 @@ describe("buildInfo", () => {
218228 sendUsageReport : sendUsageReportStub ,
219229 setUsageReportingFlag : setUsageReportingFlagStub ,
220230 getUserAgent : getUserAgentStub ,
231+ getConfigPath : getConfigPathStub
221232 } ,
222233 request : { get : requestStub } ,
223234 } ) ;
@@ -228,6 +239,7 @@ describe("buildInfo", () => {
228239 . then ( function ( _bsConfig ) {
229240 sinon . assert . calledOnce ( requestStub ) ;
230241 sinon . assert . calledOnce ( getUserAgentStub ) ;
242+ sinon . assert . calledOnce ( getConfigPathStub ) ;
231243 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
232244 } )
233245 . catch ( ( error ) => {
@@ -244,6 +256,7 @@ describe("buildInfo", () => {
244256 setUsernameStub = sandbox . stub ( ) ;
245257 setAccessKeyStub = sandbox . stub ( ) ;
246258 validateBstackJsonStub = sandbox . stub ( ) ;
259+ getConfigPathStub = sandbox . stub ( ) ;
247260 setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
248261 getUserAgentStub = sandbox . stub ( ) . returns ( "random user-agent" ) ;
249262 sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -273,6 +286,7 @@ describe("buildInfo", () => {
273286 sendUsageReport : sendUsageReportStub ,
274287 setUsageReportingFlag : setUsageReportingFlagStub ,
275288 getUserAgent : getUserAgentStub ,
289+ getConfigPath : getConfigPathStub
276290 } ,
277291 request : { get : requestStub } ,
278292 } ) ;
@@ -283,6 +297,7 @@ describe("buildInfo", () => {
283297 . then ( function ( _bsConfig ) {
284298 sinon . assert . calledOnce ( requestStub ) ;
285299 sinon . assert . calledOnce ( getUserAgentStub ) ;
300+ sinon . assert . calledOnce ( getConfigPathStub ) ;
286301 sinon . assert . calledOnceWithExactly ( sendUsageReportStub , bsConfig , args , message , messageType , errorCode ) ;
287302 } ) . catch ( ( error ) => {
288303 chai . assert . isNotOk ( error , 'Promise error' ) ;
@@ -297,6 +312,7 @@ describe("buildInfo", () => {
297312 sandbox = sinon . createSandbox ( ) ;
298313 setUsernameStub = sandbox . stub ( ) ;
299314 setAccessKeyStub = sandbox . stub ( ) ;
315+ getConfigPathStub = sandbox . stub ( ) ;
300316 validateBstackJsonStub = sandbox . stub ( ) ;
301317 setUsageReportingFlagStub = sandbox . stub ( ) . returns ( undefined ) ;
302318 sendUsageReportStub = sandbox . stub ( ) . callsFake ( function ( ) {
@@ -319,6 +335,7 @@ describe("buildInfo", () => {
319335 getErrorCodeFromErr : getErrorCodeFromErrStub ,
320336 sendUsageReport : sendUsageReportStub ,
321337 setUsageReportingFlag : setUsageReportingFlagStub ,
338+ getConfigPath : getConfigPathStub
322339 } ,
323340 } ) ;
324341
0 commit comments