@@ -207,22 +207,22 @@ describe('instantiate client', () => {
207
207
test ( 'in request options' , ( ) => {
208
208
const client = new OnebusawaySDK ( { apiKey : 'My API Key' } ) ;
209
209
expect ( client . buildURL ( '/foo' , null , 'http://localhost:5000/option' ) ) . toEqual (
210
- ' http://localhost:5000/option/foo' ,
210
+ ` http://localhost:5000/option/foo?key= ${ encodeURIComponent ( client . apiKey ) } ` ,
211
211
) ;
212
212
} ) ;
213
213
214
214
test ( 'in request options overridden by client options' , ( ) => {
215
215
const client = new OnebusawaySDK ( { apiKey : 'My API Key' , baseURL : 'http://localhost:5000/client' } ) ;
216
216
expect ( client . buildURL ( '/foo' , null , 'http://localhost:5000/option' ) ) . toEqual (
217
- ' http://localhost:5000/client/foo' ,
217
+ ` http://localhost:5000/client/foo?key= ${ encodeURIComponent ( client . apiKey ) } ` ,
218
218
) ;
219
219
} ) ;
220
220
221
221
test ( 'in request options overridden by env variable' , ( ) => {
222
222
process . env [ 'ONEBUSAWAY_SDK_BASE_URL' ] = 'http://localhost:5000/env' ;
223
223
const client = new OnebusawaySDK ( { apiKey : 'My API Key' } ) ;
224
224
expect ( client . buildURL ( '/foo' , null , 'http://localhost:5000/option' ) ) . toEqual (
225
- ' http://localhost:5000/env/foo' ,
225
+ ` http://localhost:5000/env/foo?key= ${ encodeURIComponent ( client . apiKey ) } ` ,
226
226
) ;
227
227
} ) ;
228
228
} ) ;
0 commit comments