@@ -47,6 +47,7 @@ describe("parser", () => {
4747 delete process . env . CS_DISABLE_FILE_DOWNLOADS
4848 delete process . env . CS_DISABLE_GETTING_STARTED_OVERRIDE
4949 delete process . env . VSCODE_PROXY_URI
50+ delete process . env . CS_DISABLE_PROXY
5051 console . log = jest . fn ( )
5152 } )
5253
@@ -103,6 +104,8 @@ describe("parser", () => {
103104
104105 "--disable-getting-started-override" ,
105106
107+ "--disable-proxy" ,
108+
106109 [ "--session-socket" , "/tmp/override-code-server-ipc-socket" ] ,
107110
108111 [ "--host" , "0.0.0.0" ] ,
@@ -123,6 +126,7 @@ describe("parser", () => {
123126 } ,
124127 "disable-file-downloads" : true ,
125128 "disable-getting-started-override" : true ,
129+ "disable-proxy" : true ,
126130 enable : [ "feature1" , "feature2" ] ,
127131 help : true ,
128132 host : "0.0.0.0" ,
@@ -392,6 +396,30 @@ describe("parser", () => {
392396 } )
393397 } )
394398
399+ it ( "should use env var CS_DISABLE_PROXY" , async ( ) => {
400+ process . env . CS_DISABLE_PROXY = "1"
401+ const args = parse ( [ ] )
402+ expect ( args ) . toEqual ( { } )
403+
404+ const defaultArgs = await setDefaults ( args )
405+ expect ( defaultArgs ) . toEqual ( {
406+ ...defaults ,
407+ "disable-proxy" : true ,
408+ } )
409+ } )
410+
411+ it ( "should use env var CS_DISABLE_PROXY set to true" , async ( ) => {
412+ process . env . CS_DISABLE_PROXY = "true"
413+ const args = parse ( [ ] )
414+ expect ( args ) . toEqual ( { } )
415+
416+ const defaultArgs = await setDefaults ( args )
417+ expect ( defaultArgs ) . toEqual ( {
418+ ...defaults ,
419+ "disable-proxy" : true ,
420+ } )
421+ } )
422+
395423 it ( "should error if password passed in" , ( ) => {
396424 expect ( ( ) => parse ( [ "--password" , "supersecret123" ] ) ) . toThrowError (
397425 "--password can only be set in the config file or passed in via $PASSWORD" ,
0 commit comments