@@ -17,7 +17,7 @@ const portRange = 1000;
1717 * Lists of tests known to use `Registry`. This is used to make each test try a different
1818 * port range to avoid collisions caused by race conditions with grabbing free ports.
1919 */
20- const knownTests = [ 'packagePublish' , 'publishE2E' , 'publishNpm' , 'syncE2E' ] ;
20+ const knownTests = [ 'packagePublish' ] ;
2121
2222// NOTE: If you are getting timeouts and port collisions, set jest.setTimeout to a higher value.
2323// The default value of 5 seconds may not be enough in situations with port collisions.
@@ -71,15 +71,21 @@ export class Registry {
7171 try {
7272 const registry = this . getUrl ( ) ;
7373 console . log ( `logging in to ${ registry } ` ) ;
74- const npm = execa ( 'npm' , [ 'adduser' , '--registry' , registry ] ) ;
74+ const npm = execa ( 'npm' , [ 'login' , '--registry' , registry , '--verbose' ] ) ;
75+ // If this is failing or hanging and you need to debug:
76+ // npm.stdout?.pipe(process.stdout);
77+ // npm.stderr?.pipe(process.stderr);
78+ // With Node 22+ and verdaccio 5, the npm login HTTP request fails for some reason.
79+ // This is fixed with latest verdaccio, which we can bump when bumping Node.
80+
7581 // for some reason there's no way to supply the username, password, and email besides stdin
7682 npm . stdout ?. on ( 'data' , chunk => {
7783 const chunkStr = String ( chunk ) ;
7884 if ( chunkStr . includes ( 'Username:' ) ) {
7985 npm . stdin ?. write ( verdaccioUser . username + '\r\n' ) ;
8086 } else if ( chunkStr . includes ( 'Password:' ) ) {
8187 npm . stdin ?. write ( verdaccioUser . password + '\r\n' ) ;
82- } else if ( chunkStr . includes ( 'Email:' ) ) {
88+ } else if ( chunkStr . includes ( 'Email:' ) || chunkStr . includes ( 'Email (' ) ) {
8389 npm . stdin ?. write ( 'fake@example.com\r\n' ) ;
8490 }
8591 } ) ;
0 commit comments