File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,23 @@ describe("auth browser utilities", () => {
114114 expect ( mockedSpawn ) . not . toHaveBeenCalled ( ) ;
115115 } ) ;
116116
117+ it ( "does not treat CODEX_AUTH_NO_BROWSER=false as suppression when BROWSER is disabled" , ( ) => {
118+ process . env . CODEX_AUTH_NO_BROWSER = "false" ;
119+ process . env . BROWSER = "none" ;
120+
121+ expect ( isBrowserLaunchSuppressed ( ) ) . toBe ( false ) ;
122+ expect ( openBrowserUrl ( "https://example.com" ) ) . toBe ( false ) ;
123+ expect ( mockedSpawn ) . not . toHaveBeenCalled ( ) ;
124+ } ) ;
125+
126+ it ( "suppresses browser launch when BROWSER is set to none" , ( ) => {
127+ process . env . BROWSER = "none" ;
128+
129+ expect ( isBrowserLaunchSuppressed ( ) ) . toBe ( true ) ;
130+ expect ( openBrowserUrl ( "https://example.com" ) ) . toBe ( false ) ;
131+ expect ( mockedSpawn ) . not . toHaveBeenCalled ( ) ;
132+ } ) ;
133+
117134 it ( "keeps suppression enabled when CODEX_AUTH_NO_BROWSER is truthy even if BROWSER is also disabled" , ( ) => {
118135 process . env . CODEX_AUTH_NO_BROWSER = "true" ;
119136 process . env . BROWSER = "none" ;
You can’t perform that action at this time.
0 commit comments