@@ -91,6 +91,52 @@ test('Returns user config via alternative environment variables', t => {
9191 ) ;
9292} ) ;
9393
94+ test ( 'Returns user config via alternative environment variables with https proxy and no proto scheme set' , t => {
95+ const gitlabToken = 'TOKEN' ;
96+ const gitlabUrl = 'host.com' ;
97+ const gitlabApiPathPrefix = '/api/prefix' ;
98+ const assets = [ 'file.js' ] ;
99+ // Testing with 8080 port because HttpsProxyAgent ignores 80 port with http protocol
100+ const proxyUrl = 'http://proxy.test:8443' ;
101+
102+ const result = resolveConfig (
103+ { assets} ,
104+ {
105+ env : {
106+ GL_TOKEN : gitlabToken ,
107+ GL_URL : gitlabUrl ,
108+ GL_PREFIX : gitlabApiPathPrefix ,
109+ HTTPS_PROXY : proxyUrl ,
110+ } ,
111+ }
112+ ) ;
113+
114+ t . deepEqual ( result . proxy , { } ) ;
115+ } ) ;
116+
117+ test ( 'Returns user config via alternative environment variables with http proxy and no proto scheme set' , t => {
118+ const gitlabToken = 'TOKEN' ;
119+ const gitlabUrl = 'host.com' ;
120+ const gitlabApiPathPrefix = '/api/prefix' ;
121+ const assets = [ 'file.js' ] ;
122+ // Testing with 8080 port because HttpsProxyAgent ignores 80 port with http protocol
123+ const proxyUrl = 'http://proxy.test:8080' ;
124+
125+ const result = resolveConfig (
126+ { assets} ,
127+ {
128+ env : {
129+ GL_TOKEN : gitlabToken ,
130+ GL_URL : gitlabUrl ,
131+ GL_PREFIX : gitlabApiPathPrefix ,
132+ HTTP_PROXY : proxyUrl ,
133+ } ,
134+ }
135+ ) ;
136+
137+ t . deepEqual ( result . proxy , { } ) ;
138+ } ) ;
139+
94140test ( 'Returns user config via alternative environment variables with http proxy' , t => {
95141 const gitlabToken = 'TOKEN' ;
96142 const gitlabUrl = 'http://host.com' ;
0 commit comments