@@ -31,23 +31,13 @@ const { readJson, writeJson } = fsExtra;
3131
3232// Environment variables used with semantic-release cli (similar to what a user would setup)
3333const { GITHUB_ACTION , GITHUB_ACTIONS , GITHUB_TOKEN , ...processEnvWithoutGitHubActionsVariables } = process . env ;
34- const env = {
35- ...processEnvWithoutGitHubActionsVariables ,
36- ...npmRegistry . authEnv ,
37- CI : "true" ,
38- GH_TOKEN : gitbox . gitCredential ,
39- TRAVIS : "true" ,
40- TRAVIS_BRANCH : "master" ,
41- TRAVIS_PULL_REQUEST : "false" ,
42- GITHUB_API_URL : mockServer . url ,
43- } ;
34+ let env ;
4435
4536// Environment variables used only for the local npm command used to do verification
4637const npmTestEnv = {
4738 ...process . env ,
48- ...npmRegistry . authEnv ,
39+ ...npmRegistry . authEnv ( ) ,
4940 npm_config_registry : npmRegistry . url ,
50- LEGACY_TOKEN : Buffer . from ( `${ env . NPM_USERNAME } :${ env . NPM_PASSWORD } ` , "utf8" ) . toString ( "base64" ) ,
5141} ;
5242
5343const cli = path . resolve ( "./bin/semantic-release.js" ) ;
@@ -57,6 +47,17 @@ const pluginLogEnv = path.resolve("./test/fixtures/plugin-log-env");
5747
5848test . before ( async ( ) => {
5949 await Promise . all ( [ gitbox . start ( ) , npmRegistry . start ( ) , mockServer . start ( ) ] ) ;
50+
51+ env = {
52+ ...processEnvWithoutGitHubActionsVariables ,
53+ ...npmRegistry . authEnv ( ) ,
54+ CI : "true" ,
55+ GH_TOKEN : gitbox . gitCredential ,
56+ TRAVIS : "true" ,
57+ TRAVIS_BRANCH : "master" ,
58+ TRAVIS_PULL_REQUEST : "false" ,
59+ GITHUB_API_URL : mockServer . url ,
60+ } ;
6061} ) ;
6162
6263test . after . always ( async ( ) => {
0 commit comments