File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export async function createNpmRegistry(
4949// Token was generated using `echo -n 'testing:s3cret' | openssl base64`.
5050const VALID_TOKEN = `dGVzdGluZzpzM2NyZXQ=` ;
5151
52- export function createNpmConfigForAuthentication (
52+ export async function createNpmConfigForAuthentication (
5353 /**
5454 * When true, the authentication token will be scoped to the registry URL.
5555 * @example
@@ -70,17 +70,30 @@ export function createNpmConfigForAuthentication(
7070 const token = invalidToken ? `invalid=` : VALID_TOKEN ;
7171 const registry = ( getGlobalVariable ( 'package-secure-registry' ) as string ) . replace ( / ^ \w + : / , '' ) ;
7272
73- return writeFile (
73+ await writeFile (
7474 '.npmrc' ,
7575 scopedAuthentication
7676 ? `
77- ${ registry } :_auth="${ token } "
78- registry=http:${ registry }
79- `
77+ ${ registry } :_auth="${ token } "
78+ registry=http:${ registry }
79+ `
8080 : `
81- _auth="${ token } "
82- registry=http:${ registry }
83- ` ,
81+ _auth="${ token } "
82+ registry=http:${ registry }
83+ ` ,
84+ ) ;
85+
86+ await writeFile (
87+ '.yarnrc' ,
88+ scopedAuthentication
89+ ? `
90+ ${ registry } :_auth "${ token } "
91+ registry http:${ registry }
92+ `
93+ : `
94+ _auth "${ token } "
95+ registry http:${ registry }
96+ ` ,
8497 ) ;
8598}
8699
Original file line number Diff line number Diff line change @@ -233,8 +233,8 @@ process.env.CHROMEDRIVER_BIN = path.resolve(process.env.CHROMEDRIVER_BIN!);
233233 findFreePort ( ) ,
234234 findPackageTars ( ) ,
235235 ] ) ;
236- setGlobalVariable ( 'package-registry' , 'http://localhost:' + httpPort ) ;
237- setGlobalVariable ( 'package-secure-registry' , 'http://localhost:' + httpsPort ) ;
236+ setGlobalVariable ( 'package-registry' , 'http://localhost:' + httpPort + '/' ) ;
237+ setGlobalVariable ( 'package-secure-registry' , 'http://localhost:' + httpsPort + '/' ) ;
238238 setGlobalVariable ( 'package-tars' , packageTars ) ;
239239
240240 // NPM registries for the lifetime of the test execution
You can’t perform that action at this time.
0 commit comments