File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
tests/legacy-cli/e2e/utils Expand file tree Collapse file tree 1 file changed +21
-8
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
You can’t perform that action at this time.
0 commit comments