@@ -47,6 +47,7 @@ describe("parser", () => {
47
47
delete process . env . CS_DISABLE_FILE_DOWNLOADS
48
48
delete process . env . CS_DISABLE_GETTING_STARTED_OVERRIDE
49
49
delete process . env . VSCODE_PROXY_URI
50
+ delete process . env . CS_DISABLE_PROXY
50
51
console . log = jest . fn ( )
51
52
} )
52
53
@@ -103,6 +104,8 @@ describe("parser", () => {
103
104
104
105
"--disable-getting-started-override" ,
105
106
107
+ "--disable-proxy" ,
108
+
106
109
[ "--session-socket" , "/tmp/override-code-server-ipc-socket" ] ,
107
110
108
111
[ "--host" , "0.0.0.0" ] ,
@@ -123,6 +126,7 @@ describe("parser", () => {
123
126
} ,
124
127
"disable-file-downloads" : true ,
125
128
"disable-getting-started-override" : true ,
129
+ "disable-proxy" : true ,
126
130
enable : [ "feature1" , "feature2" ] ,
127
131
help : true ,
128
132
host : "0.0.0.0" ,
@@ -392,6 +396,30 @@ describe("parser", () => {
392
396
} )
393
397
} )
394
398
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
+
395
423
it ( "should error if password passed in" , ( ) => {
396
424
expect ( ( ) => parse ( [ "--password" , "supersecret123" ] ) ) . toThrowError (
397
425
"--password can only be set in the config file or passed in via $PASSWORD" ,
0 commit comments