@@ -331,7 +331,7 @@ describe('Config Reader module', function () {
331331 var configReader = ConfigReader . create ( {
332332 apiKey : 'test' ,
333333 reporter : 'dummy' ,
334- configPath : 'test'
334+ serviceName : 'test'
335335 } )
336336
337337 try {
@@ -345,6 +345,39 @@ describe('Config Reader module', function () {
345345 } )
346346
347347 describe ( 'config variable' , function ( ) {
348+ describe ( 'traceProxy' , function ( ) {
349+ it ( 'should be configurable with the HTTP_PROXY env var' , function ( ) {
350+ this . sandbox . stub ( process , 'env' , {
351+ HTTP_PROXY : 'http://proxy.com'
352+ } )
353+
354+ var configReader = ConfigReader . create ( {
355+ apiKey : testApiToken ,
356+ reporter : 'dummy' ,
357+ serviceName : 'test'
358+ } )
359+
360+ var config = configReader . getConfig ( )
361+
362+ expect ( config . proxy ) . to . equal ( 'http://proxy.com' )
363+ } )
364+ it ( 'TRACE_PROXY env var takes precedence over HTTP_PROXY' , function ( ) {
365+ this . sandbox . stub ( process , 'env' , {
366+ TRACE_PROXY : 'http://trace-proxy.com' ,
367+ HTTP_PROXY : 'http://proxy.com'
368+ } )
369+
370+ var configReader = ConfigReader . create ( {
371+ apiKey : testApiToken ,
372+ reporter : 'dummy' ,
373+ serviceName : 'test'
374+ } )
375+
376+ var config = configReader . getConfig ( )
377+
378+ expect ( config . proxy ) . to . equal ( 'http://trace-proxy.com' )
379+ } )
380+ } )
348381 describe ( 'disableInstrumentations' , function ( ) {
349382 it ( 'defaults to []' , function ( ) {
350383 var configReader = ConfigReader . create ( {
0 commit comments