File tree Expand file tree Collapse file tree
__functional__/packageManager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,11 +150,8 @@ export class Registry {
150150
151151 /** Run `npm logout` on the fake registry */
152152 public async logout ( ) : Promise < void > {
153- if ( ! this . isLoggedIn ) {
154- return ;
155- }
156-
157- // Conservatively set to false even if it fails partway (logging in again is harmless)
153+ // Conservatively set to false even if it fails partway (logging in again is harmless).
154+ // Also go ahead and log out even if not flagged as logged in since it could be out of sync.
158155 this . isLoggedIn = false ;
159156 try {
160157 const registry = this . getUrl ( ) ;
Original file line number Diff line number Diff line change @@ -184,11 +184,12 @@ describe('packagePublish', () => {
184184 expect ( logs2ndTry ) . toMatch ( `${ testSpec } already exists in the registry` ) ;
185185 } ) ;
186186
187- // TODO: remove it.skip once node version is upgraded (this test doesn't work with npm 6 because
187+ // TODO: remove condition once node version is upgraded (this test doesn't work with npm 6 because
188188 // that version seems to allow truly anonymous publishing with verdaccio)
189- // eslint-disable-next-line no-restricted-properties
190- const itNotNpm6 = npmVersion . startsWith ( '6' ) ? it . skip : it ;
191- itNotNpm6 ( 'handles auth error and does not retry' , async ( ) => {
189+ it ( 'handles auth error and does not retry' , async ( ) => {
190+ if ( npmVersion . startsWith ( '6.' ) ) {
191+ return ;
192+ }
192193 await registry . logout ( ) ;
193194
194195 const testPackageInfo = getTestPackageInfo ( ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ export async function packageManager(
1919 const result = await execa ( manager , args , {
2020 ...options ,
2121 // This is required for Windows due to https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
22- shell : true ,
22+ // but only provide it on Windows because it breaks oddly-named environment variables
23+ // such as npm_config_//someRegistry/:_authToken on Linux...
24+ ...( process . platform === 'win32' && { shell : true } ) ,
2325 } ) ;
2426 return {
2527 ...result ,
You can’t perform that action at this time.
0 commit comments